it’s built in
$wp_query->post_count is the # of posts on the page
$wp_query->current_post is the # of the current post on the page
current post starts at zero, post_count starts at 1
Hi,
I personally refer you to go with the statcounter plugin for statistics for your site..you can download it from here:
http://ww.wp.xz.cn/extend/plugins/official-statcounter-plugin-for-wordpress/
Thanks,
Shane G.
stvwlf,
i undestand that the <?php the_ID(); ?> tag does the counting automatically.
but its count is very strange.. cause it goes from 49 on the first post to 43 on the second post.
what i really need is a simple increasing id number.. starting from 0.
exactly like this:
<div id=’post0′> for post one (most recent post)
<div id=’post1′> for post two
…
until..
<div id=’post9′> for post ten (last post of the page)
i know that textpattern has a plugin called rvm_counter that does this like a charm. but I wanted something for wordpress.
how can I add this on the loop? is that possible on wordpress?
thanks in advance.
oh, i got it now.
i wrote <div id=”post<?php echo($wp_query->current_post + 1); ?>”> to the loop and it worked.
thanks! 🙂
Is it posible to show count from last one ?
post 11
post 10
….