Insert html between posts

A nice way to insert custom html code only between each posts. The last post is skipped so this is a smart solution to add a visual post divider or something similar.

/**
 * Snippet Name: Insert html between posts
 * Snippet URL: https://www.wpcustoms.net/snippets/insert-html-between-posts/
 */
  if (($wp_query->current_post + 1) post_count)) {
   echo '
Post Divider
'; }
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x