WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
[resolved] How to Display Full Post of most popular (5 posts)

  1. Dcuddies
    Member
    Posted 10 months ago #

    Hi,

    Plugin is working great, I have one page where I'd like to display the top 10 posts in their entirety.

    I'm able to get the top 10 titles for the posts, but I'm not sure how to get the posts themselves to show up, is there an easy fix to this?

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

  2. Lester Chan
    Member
    Plugin Author

    Posted 10 months ago #

    You could use WordPress function query_posts()

    <?php query_posts($query_string.'&r_sortby=most_rated&r_orderby=desc&limit=10') ?>

  3. Dcuddies
    Member
    Posted 10 months ago #

    Thanks for the reply Lester.

    It seems like that should work, but for some reason that code only returned 5 results, and they weren't the top rated ones (or most rated), but instead are the 5 most recent posts.

    Any idea why?

  4. Lester Chan
    Member
    Plugin Author

    Posted 10 months ago #

    Try this

    <?php
    $popular_posts = new WP_Query("r_sortby=most_rated&r_orderby=desc&showposts=10");
    while ($popular_posts->have_posts()):
    $popular_posts->the_post();
    ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php
    $i++;
    endwhile;
    wp_reset_query();
    ?>

  5. Dcuddies
    Member
    Posted 10 months ago #

    Worked beautifully, thanks

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.