Display Post Divider In Between Posts

0
0

Right before the closing of the The Loop, insert this code:

<?php
if (($wp_query->current_post + 1) < ($wp_query->post_count)) {
   echo '
Post Divider
'
; } ?>

This will create a <div> you can style as a post divider. The cool part being, it only gets inserted between two posts, skipping the last one. Thanks to Craig Maclean.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.