• Resolved rok24

    (@rok24)


    Hi,

    I am displaying overal rating on my main index with [RICH_REVIEWS_SNIPPET category=”page”id=”60″]:
    Overall rating: ★★★★★ based on 2 reviews

    Is there any way to display overal rating on my main index ony with stars, with no text “Overall rating: … based on 2 review”?
    ★★★★★

    Thanks

    https://wordpress.org/plugins/rich-reviews/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Nuanced Media

    (@nuanced-media)

    So this text is part of what contains the schema data that Google data crawlers will be looking for, so you don’t want to explicitly hide it. However, there are a few workarounds. For instance if you wrap the snippet shortcode in a container with a targetable class, then apply some css to reduce the font-size of everything, except the stars, to nothing, you can get the effect of removing the text without actually doing so.

    For instance:

    <div class="aggregate-rating">
    [RICH_REVIEWS_SNIPPET category="page" id="60]
    </div>
    
    <style>
    .aggregate-rating {
       font-size: 0px;
       text-align: center;
    }
    
    .aggregate-rating .stars {
        font-size: 22px;
    }
    </style>

    That should do what you are looking for. Note: the font-size of 22px for the stars is arbitrary, you can style the stars however you like, as well as the container and whatnot (ie: the text-align: center;). the key is simply applying font-size: 0; to the container then targeting the .stars element within to override the font reduction.

    Let me know if you need any further help.

    Thanks,
    Charlie Maxwell
    [NM_Developer]

    Thread Starter rok24

    (@rok24)

    Thanks, that worked! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Overall rating’ is closed to new replies.