WordPress.org

Forums

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

  1. Dcuddies
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago #

    Worked beautifully, thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.