Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #732677

    I would like to add the following code to the <head> section of just my /reviews page

    <script type=”application/ld+json”>
    { “@context”: “http://schema.org&#8221;,
    “@type”: “Product”,
    “name”: “Hypnotherapy”,
    “aggregateRating”:
    {“@type”: “AggregateRating”,
    “ratingValue”: “4.7”,
    “reviewCount”: “54”
    }
    }
    </script>

    I am running the Enfold child theme and am unsure where I should put the code and wanted some help please

    #733001

    Hey hypnorich,

    If you want to place it on one page only then we would need the id of the page. If you don’t know how to find that then please post admin login details in private.

    Best regards,
    Rikard

    #733076

    page ID is 9162

    #733483

    Hi,

    Thanks, please try the following at the end of your functions.php file:

    
    function hypnorich_add_custom_code() {
      if(is_page(9162)) { ?>
        <script type=”application/ld+json”>
        { “@context”: “http://schema.org”,
        “@type”: “Product”,
        “name”: “Hypnotherapy”,
        “aggregateRating”:
        {“@type”: “AggregateRating”,
        “ratingValue”: “4.7”,
        “reviewCount”: “54”
        }
        }
        </script>
    <?php 
      }
    }
    add_action('wp_head', 'hypnorich_add_custom_code');

    Best regards,
    Rikard

    #733527

    I have put the code in where you said but the structured data testing tool is not showing it in its report on my /reviews page. It isn’t showing any errors either though

    #733528

    Correction….it os showing it as a sub section of a different element. Looks like we are all good. Thanks for your support

    #733564

    Hi,

    Glad we could help!
    We really appreciate it if you rate our theme on themeforest https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Vinay

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to add aggregate rating id+Json to one page’ is closed to new replies.