WordPress.org

Support

Support » Plugins and Hacks » WP-PostRatings » [Resolved] Full Post of most popular with Numbering

[Resolved] Full Post of most popular with Numbering

  • Hello,

    Great plugin! Very enjoy using it!

    I’m using this code to display full post of most popular:

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

    My question, is there is any way to add numbering Posts like 1, 2 ,3 ,4 etc.? Depending on how much posts are in Most popular.

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

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

    @gamerz

    What numbering are you referring to?

    You can just print out $i?

    <h4><?php echo $i ?><?php the_title(); ?></h4>

    Numbering posts like in image , but only numbering post which are in most popular page.

    Image

    Sorry for double post, when I using <?php echo $i ?> , number one post not NR.1 , but just Nr. like in image.

    Image

    Plugin Author Lester Chan

    @gamerz

    Sorry I don’t think I am able to help you with this since it has nothing to do with the plugin. You might want to check with your theme author

    thanks any way 🙂

    Solved!

    If up code dont work for you try adding $i = 1; to :

    <?php $i = 1; while (have_posts()) : the_post(); ?>

    And then how Lester wrote

    <h4><?php echo $i ?><?php the_title(); ?></h4>

    Plugin Author Lester Chan

    @gamerz

    I thought $i is in your code but not in the snippet you pasted because at the end you did increment $i++

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Full Post of most popular with Numbering’ is closed to new replies.
Skip to toolbar