I want to have place a div between my posts, which functions like an <hr> tag. I only want this to show up between posts, so I'd like to avoid having it appear after the final post on the page. I tried code from another forum, but it isn't working for some reason.
I used this code just before the endwhile statement and the closing curly bracket:
<?php if( ($wp_query->current_post + 1) < ($wp_query->post_count) ) :?>
<span class="finalHR"></span>
<?php else :?>
<?php endif;?>
This makes sense to me, so I don't know why it doesn't work. Any light shed on this issue would be a huge help.