WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. wpoon
    Member
    Posted 11 months 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(); } ?>
                </div>

    Any help would be appreciated.

    http://wordpress.org/plugins/wp-postratings/

  2. Lester Chan
    Member
    Plugin Author

    Posted 11 months ago #

    Why are you assigning $temp to $post?

  3. wpoon
    Member
    Posted 11 months 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
    Member
    Plugin Author

    Posted 11 months 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
    Member
    Posted 11 months 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!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.