Support Center

Frequently asked questions and support documentation for RatingWidget.

Results

  • My homepage not showing any ratings, what’s wrong?

    Make sure your Front Page ratings are enabled for excerpts. In addition, your theme’s front page template must use the_excerpt() or the_content() methods to show/load the excerpts. We use this method’s hook to add the rating code. You can either try to fix that, or you can add our PHP shortcodes directly to your theme’s front page template.

  • The RatingWidget WordPress plugin don’t show ratings on my comments, what’s wrong?

    First, make sure you’ve enabled the ratings for comments in your admin’s dashboard. Once you sure it’s enabled, but still doesn’t work, a common cause can be that your theme isn’t using comment_text() to display the comments text. A common mistake by theme developers is the use of get_comment_text() instead of comment_text(). Try to switch between those and it should fix the issue. If you are awesome, contact the theme developer and let him know about the issue so he can fix it for everyone else.

  • Can I add a rating inside my WordPress post’s content?

    We created a special shortcode you can use inside your posts / pages editor.

    For posts:

    • Current post rating - [ratingwidget]
    • Specified post rating - [ratingwidget post_id=123]

    For pages:

    • Current page rating - [ratingwidget type="page"]
    • Specified page rating - [ratingwidget type="page" post_id=123]

    Rich-Snippets support:
    If you are using our Professional or Business plan which supports Rich-Snippets integration, and you want that the rendered rating will have the relevant schema, please add the add_schema=true attribute to the shortcode. For example:
    [ratingwidget post_id=123 add_schema=true]

    Note: If you already have a rating with schema.org on the same page, adding additional rating with schema.org metadata will confuse search engines, and will cause your ratings disappear from SERP.

  • Is there any PHP shortcodes I can use for my custom posts templates?

    We created several custom PHP shortcodes to make it easy for you adding RatingWidget into your custom templates or even if you want to customize the exact location of the ratings in your pages.

    Here are the shortcodes:

    • Output post / page / comment rating:
      function rw_the_post_rating($postID = false, $class = 'blog-post', $schema = false);
    • Return post / page / comment rating:
      function rw_get_post_rating($postID = false, $class = 'blog-post', $schema = false);
    • Output user rating:
      function rw_the_user_rating($userID = false);
    • Return user rating:
      function rw_get_user_rating($userID = false);

    Usage example:

    <?php rw_the_post_rating(14, 'front-post'); ?>

    Params:

    • $postID – The post id. Defaults to current’s loop post id.
    • $class - Rating class/type. For front page posts use ‘front-post’, for posts use ‘blog-post’, for pages user ‘page’, for comments use ‘comment’.
    • $schema - If TRUE, add Rich-Snippets schema.org metadata (only for Professional customers).
    • $userID - User ID. Defaults to current’s loop user.

    You can find the shortcodes implementation in /rating-widget/lib/rw-shortcodes.php

  • Do you have a refresh code for Ajax loaded content?

    In order to refresh / re-render the ratings on the page all you need to do is execute the following JavaScript line.

    RW.render(null, true);

    You can add the following code snippet right before your closing </body> tag (requires jQuery support) and it will automatically do the job.

    <script type="text/javascript">
        $(document).ajaxSuccess(function() {
            setTimeout(function(){
            if ("undefined" !== typeof(RW))
                RW.render(null, true);
            }, 500);
        });
    </script>

    If you care about efficiency, call this method only after you add new ratings’ HTML containers (not on every Ajax call).

    Using the WordPress Plugin?

    To add the snippet right in your WordPress’ footer, add the following code to your theme’s functions.php file:

        /* Append ratings render-er after ajax call.
        ------------------------------------------*/
        function rw_render_ratings_after_ajax()
        {
    ?>
    <script type="text/javascript">
    $(document).ajaxSuccess(function() {
        setTimeout(function(){
            if ("undefined" !== typeof(RW))
                RW.render(null, true);
        }, 500);
    });
    </script>
    <?php        
        }
    
        add_action('wp_footer', 'rw_render_ratings_after_ajax');