How many posts does the loop return?

I am creating a child theme archive template. I don’t know how many posts will be displayed, which is fine except that i want to have a dividing line after each post except the last one.

I am using the usual loop, have added a $loopcount variable, and then an include to create the formatting/display and add the


while ( have_posts() ) : the_post();

I have looked in the codex but I can’t find a way to know how many posts the loop is going to do in advance. (I could use jQ to do this, but it would be neater to do it with php I think)

Read more here: How many posts does the loop return?

Leave a Reply

Your email address will not be published. Required fields are marked *