2016-08-18, 00:19:19
You could do something like this:
- Note that the post author is not inserted - currently NM has no template tag for this.
- Also note that the dateModified field contains the post date, not the lastmod date (same reason)
PHP Code:
<?php if (nm_is_single()) { ?>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "PublicationIssue",
// "name": "My Blog",
// "ispartof": "...",
// "mainEntity": "...",
"headline": "<?php nm_post_title(); ?>",
"description": "<?php nm_post_excerpt(150, '...'); ?>",
// "image": "...",
// "editor": "...",
// "accountablePerson": "...",
"dateCreated": "<?php nm_post_date('%Y-%m-%d'); ?>",
"datepublished": "<?php nm_post_date('%Y-%m-%d'); ?>",
"dateModified": "<?php nm_post_date('%Y-%m-%d'); ?>",
"copyrightHolder":{
"@type": "Person",
"name": "me"},
"author":{
"@type": "Person",
"name": "me"},
"url": "<?php nm_post_url(); ?>"
}
</script>
<?php } ?>
- Note that the post author is not inserted - currently NM has no template tag for this.
- Also note that the dateModified field contains the post date, not the lastmod date (same reason)