Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 64413

Location for page specific scripts

$
0
0

Replies: 0

Hi, I’m looking to add some schema to a specific page. I found tutorials on how to add the JSON-LD to a custom field, and then add some code to the header.php which pulls it in based on the page ID.

However, I noticed that in the page editing screen of wordpress, it has a section to add “Page-specific Scripts.

If I put the json-ld script in there, will it be output to the head or body? Is this acceptable or not? The script would look something like this (I think):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Product",
  "description": "The description of my product goes here",
  "name": "The name of my product goes here",
  "image": "http://www.mydomain.com/pictureofmyproduct.jpg",
  "offers": {
    "@type": "Offer",
    "price": "11.00",
    "priceCurrency": "USD"
  },
}
</script>

Thanks for the help!


Viewing all articles
Browse latest Browse all 64413