content top
Divide your posts

Divide your posts

I have to say that normally if I want to separate posts on my index file, I would use CSS to accomplish it site fiable achat viagra. However, the annoying aspect to this is that you need to play around with it a bit in order to stop the divider from showing on your last post in the list.

The following code makes this very easy though, because it removes the last divider automatically. Of course, you may still need to use this in unison with your CSS, but it does make it a lot easier.

if (($wp_query->current_post + 1) < ($wp_query->post_count)) {
echo ‘<div class="post-divider">Post Divider</div>’;

Leave a Reply

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