Displaying Recent Posts in the Last 12 hours only (2 posts)

  1. Klark0
    Posted 7 years ago #

    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">
    $current_day = date('j');
    $recent = new WP_Query("cat=1&showposts=100&day='.$current_day.'"); while($recent->have_posts()) : $recent->the_post();?>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php endwhile; ?>
  2. Klark0
    Posted 7 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.