Post Dates that indicate Today, Yesterday, or the post date
-
Hello,
I am trying to create a recent post list that includes the post date, but I would like the post date to read “Today”, “Yesterday”, or the actual post date if the post was not published today or yesterday. I’ve got the recent list code working just fine, but I can’t seem to figure out how to do the Today and Yesterday part.This is the recent post code I am using:
<?php $args=array('showposts'=>10,'caller_get_posts'=>1); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><?php the_time('l F d, Y'); ?> - <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> <?php endwhile; } ?>
Thanks ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Post Dates that indicate Today, Yesterday, or the post date’ is closed to new replies.