After an extenisive search I finally found the following code that lets me display my WP posts on a WP page. This is great, but what I really need is to be able to display just the posts created in the last 24 hours. Does anyone know what changes I need to make to limit the results to just the last 24 hours or so? <?php/* Template Name: All posts */ ?> <?php $debut = 0; //The first article to be displayed ?> <?php while(have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <ul> <?php $myposts = get_posts('numberposts=-1&offset=$debut'); foreach($myposts as $post) : ?> <li><?php the_time('d/m/y') ?>: <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <?php endwhile; ?> Code (markup): Thank you very much
There is plenty of examples out there - basically what you need to do is introduce a filter before the get_posts - look at this thread: http://wordpress.stackexchange.com/...t-24-hours-and-order-them-based-on-most-views - what you want is a bit down the page.