How to get and display post’s “position” in the query?
-
Hello,
I have a simple query:
$query = new WP_Query('showposts=5');
that will obviously display 5 latest posts. Is there any way to be able to get post’s position in the query? By position I mean… $query has 5 posts, and I need to be able to display the number of a post in the loop. I don’t really know PHP but I’m assuming the $query is an array variable (?) with these 5 posts.It’s gonna be used in the JavaScript slider thing, where for every post I display a link like
<a href="#1"></a>
and I need that number to be 2 for the second post, 3 for the third etc.Hope that makes any sense and someone will be able to help me.
Thanks in advance,
Justine
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to get and display post’s “position” in the query?’ is closed to new replies.