Skip to content

Instantly share code, notes, and snippets.

@daviddarke
Last active September 23, 2016 09:04
Show Gist options
  • Save daviddarke/14b4fc2732e615630cabc2326613b392 to your computer and use it in GitHub Desktop.
Save daviddarke/14b4fc2732e615630cabc2326613b392 to your computer and use it in GitHub Desktop.
Used for adding structured data to blog post in wordpress
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{post.link}}"
},
"headline": "{{ post.title }}",
"image": {
"@type": "ImageObject",
"url": "{{post.thumbnail.src}}",
"height": {{ post.thumbnail.height }},
"width": {{ post.thumbnail.width}}
},
"datePublished": "{{ post.post_date | date("c") }}",
"dateModified": "{{ post.post_modified | date("c") }}",
"author": {
"@type": "Person",
"name": "{{ post.author }}"
},
"publisher": {
"@type": "Organization",
"name": "Atomic Smash",
"logo": {
"@type": "ImageObject",
"url": "LINK_TO_YOUR_LOGO",
"width": 300,
"height": 60
}
},
"description": "{{post.post_excerpt}}"
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment