[resolved] Ratings being displayed even though they haven't been rated (5 posts)

  1. wpoon
    Posted 3 years ago #

    Hi, so I've been trying to use your plugin with my custom theme for my wordpress website. I've been trying to add the following code to my single.php page, but whenever I browse to a blog post that I know I haven't rated, it displays a vote for it already.

    The code I added was:

    <div id="rating-block">
                    <h5>Rate Article</h5>
                    <?php if(function_exists('the_ratings')) { $post = $temp; the_ratings(); } ?>

    Any help would be appreciated.


  2. Lester Chan
    Plugin Author

    Posted 3 years ago #

    Why are you assigning $temp to $post?

  3. wpoon
    Posted 3 years ago #

    I was testing out whether or not $post changes (since I run a whole bunch of WP_Query's above that code). So I assigned $temp to global $post to keep track of the current page's post.

  4. Lester Chan
    Plugin Author

    Posted 3 years ago #

    So does it change?

    I would recommend http://codex.wordpress.org/Function_Reference/wp_reset_query after each query post. u might need to check the ratings function to see if the post id being pass to it is correct.

    I got a feeling this has nothing to do with the plugin but how is your theme handling the post in the query.

  5. wpoon
    Posted 3 years ago #

    Thanks, that worked.

    It was an issue to do with the system not understanding which post it was on, therefore showing the wrong rating for that page!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.