WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Klark0
    Member
    Posted 5 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">
    <?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>
  2. Klark0
    Member
    Posted 5 years ago #

    Anybody?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.