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.
- Tech Tricks answered 2 years ago
- You must login to post comments
Your Answer
Please login first to submit.