Friday, July 12, 2013

How to Display Post Divider In Between Posts in WordPress Website

This snippet code below will create a div tag and you can style it as a post divider. The cool part being, it only gets inserted between two posts, skipping the last one.

<?php
if (($wp_query->current_post + 1) < ($wp_query->post_count)) {
echo '<div class="post-item-divider">Post Divider</div>';
}
?>

Note: insert this code right before the closing of the The Loop:
Disqus Comments