I place a div around the five latest posts to display a dotted border between the posts. There is no border after the last post thanks to the last-of-type selector. It works perfectly well, but not in IE8 which lacks support. Can anyone help with a PHP solution for IE8?
while ($my_query->have_posts()) : $my_query->the_post();
?>
The css:
div.post-item {
border-bottom: 1px dotted #b4b4b4;
}
div.post-item:last-of-type {
border: none;
}
The snippet below was recommended in a post by Chris Coyier:
if (($wp_query->current_post + 1) < ($wp_query->post_count)) {
echo 'Post Divider
';
}
?>
But it displays the divider above the top/newest post as well as between the posts.