Check for last post in loop
-
I am trying to check for the last post in a loop.
I need to add a <hr /> under each recent post but not the last post in the loop.In previous themes I have used:
<?php if( ($wp_query->current_post + 1) < ($wp_query->post_count) ) { ?><div class="clear"><hr /></div><?php } ?>
Except I doesn’t work in this case. I think it has something to do with the fact I am not using a standard wp_query.
Has anyone had this problem before and know how to get past it?
My current code can be seen here:
https://pastebin.com/YdgTqH1y
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Check for last post in loop’ is closed to new replies.