WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to Display Full Post of most popular

[Resolved] How to Display Full Post of most popular

  • Dcuddies
    Member

    @dcuddies

    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Lester Chan
    Participant

    @gamerz

    You could use WordPress function query_posts()

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

    Dcuddies
    Member

    @dcuddies

    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?

    Plugin Author Lester Chan
    Participant

    @gamerz

    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();
    ?>

    Dcuddies
    Member

    @dcuddies

    Worked beautifully, thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] How to Display Full Post of most popular’ is closed to new replies.