Remove First Month
-
Hello fellow WordPress forum members!
I have a PHP script I’m using to display a list of all posts in an archive, and dividing the list into months, but I would really like to know how can I remove the first month from rendering with PHP. Here is my current code:
<?php $prev_date = NULL; $date = NULL; ?> <?php query_posts("posts_per_page=-1&order=DESC"); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $date = get_the_time('m.Y'); if($date != $prev_date) { $prev_date = $date; echo "<li class='month'>"; echo get_the_time('F'); echo "</li>"; } ?>At this moment, and for the time being, I’m using CSS3 to hide the first child element with a class of “month”, since individual months get a class of “month”, but I would like to remove the markup all together.
Thanks in advanced!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Remove First Month’ is closed to new replies.