Adding specific HEADER code (script) into a specific Page of WORDPRESS including WOOCOMMERCE products

Steps to Block IP Address From Plesk (For VPS and Dedicated Server)
May 1, 2017
Remove the WooCommerce 3.+ JSON/LD Structured Data format
May 3, 2017

Adding specific HEADER code (script) into a specific Page of WORDPRESS including WOOCOMMERCE products

wp-pageid

 

Insert into header.php before ending the head tag:

<?php $id = get_the_ID(); if( $id == 3494 ) { ?>
<script type=”application/ld+json”>
{
“@context” : “http://schema.org”,
“@type” : “Product”,
“name” : “DARK BLUE STONE PAVERS & TILES NON SLIP SURFACE”,
“image” : “https://stone-pavers.com.au/wp-content/uploads/2017/03/BLUE-STONE-PAVERS-TILES-510×382.jpg”,
“brand” : {
“@type” : “Brand”,
“name” : “Stone Pavers Pty”,
“logo” : “https://stone-pavers.com.au/wp-content/uploads/2016/10/logo.png.pagespeed.ce.hOUsnr9oIQ.png”
},
“offers” : {
“@type” : “Offer”,
“price” : “49”, “priceCurrency”: “AUD”
}
}
</script>
<?php } ?>
</head>

Comments are closed.