Well after 2 hours of Googling, i’ve only found how to show recent posts in the last day. I actually haven’t even got that to work.
Does anyone have any idea on how I can accomplish showing posts made in the last 12 hours only?
If it’s not possible, then I’d settle for the last day only:
Here’s what I got for that, but it’s not working
<ul id="news"> <?php $current_day = date('j'); $recent = new WP_Query("cat=1&showposts=100&day='.$current_day.'"); while($recent->have_posts()) : $recent->the_post();?> <li> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </li> <?php endwhile; ?> </ul>
- The topic ‘Displaying Recent Posts in the Last 12 hours only’ is closed to new replies.