• Resolved NicMic

    (@nicmic)


    Hi,
    I’m trying to show star categories on my categories pages.
    The stars don’t appear by default (can’t find a setting to), so I tried to add the function :

    	gdrts_render_rating(array('echo' => true, 'entity' => 'categories', 'name' => 'gateogies', 'id' => $cat_id));
    

    That works for voting, but it does NOT add metadata to the page. How can I achieve that?

    I tried looking at the documentation, but even after registering / logging in, the page :

    https://support.dev4press.com/forums/topic/show-average-aggregate-rating-on-category-page/

    says that I do not have permission to view the page.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Milan Petrovic

    (@gdragon)

    What is ‘gateogies’?

    The function should be:

    gdrts_render_rating(array('echo' => true, 'entity' => 'terms', 'name' => 'category', 'id' => $cat_id));

    You have all entity/name combinations on the Rating Types page.

    The document you are referencing is for the Pro version and its aggregate function – an average of all posts from a category, or something else. The function call above allows users to rate current category term. If you need rating aggregation, that is only available in Pro version.

    Milan

    Thread Starter NicMic

    (@nicmic)

    Thank you for replying.

    I meant “categories”, sorry.

    The code you provided works in that the stars are displayed on the category page, but the markup for rich snippets is not being included. That is, when I test the category page in https://search.google.com/structured-data/testing-tool/ , it doesn’t show anything. How can I include that ?

    Plugin Author Milan Petrovic

    (@gdragon)

    You can’t include markup there, because Google is only accepting snippets from singular posts, not archives.

    Thread Starter NicMic

    (@nicmic)

    Thank you again. I am not sure if I was clear in my explanation.

    The current code I run on my website is :
    echo kk_star_ratings($cat_id);
    which works fine. In the Google search results, my category pages have stars shown next to them (since users can vote on how much they like specific categories).

    I would like to migrate to GD Rating (to rate comments). The stars are shown on the category page itself, but not on the SERPS. They are missing a code similar to this :

    <div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> <div itemprop="name" class="kksr-title"></div><span itemprop="ratingValue">4.7</span> (93.04%) <span itemprop="ratingCount">69</span> votes <meta itemprop="bestRating" content="5"/> <meta itemprop="worstRating" content="1"/> <div itemprop="itemReviewed" itemscope itemtype="https://schema.org/CreativeWork">

    which is output by the current plugin.

    Is there no way to include this metadata when rendering the stars ?

    Plugin Author Milan Petrovic

    (@gdragon)

    You can do it, but again, Google will not use it, it is not valid because it is archive. But, you have settings in the Rich Snippets for including on single post only, and you can disable it.

    Thread Starter NicMic

    (@nicmic)

    This might be, like some other Google rules, not an absolute rule. See here:
    https://nmichel.net/cate.png
    where there are stars on categories. Would you have the link the the Google recommandations for not including it on archives pages?

    Btw, the setting has an unexpected result for me: the metadata is inlucded on the page, but it is for the first article, not the category itself.

    In the end, I’m certainly going to take your advice and remove them from categories.

    Thanks again,

    Plugin Author Milan Petrovic

    (@gdragon)

    For some CMS systems, Google doesn’t make the distinction between page types, but for WordPress is does. You can check the Google snippets specs for more information. I plan to add some extra control for the snippets in the future versions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Stars on categories’ is closed to new replies.