I would like to display on Front Page a Daily Digest, limited to Last 3 Days. Ideally, I could also paginate with "previous entries".
Exmample:
Friday 15 April 2011
Post 2
Post 1
Friday 14 April 2011
Post 2
Post 1
Here's a screenshot of what I have using this code from @MichaelH:
[mod: please remember to use the pastebin for codes longer than 10 lines]
<?php
// list all posts, sectioned by post date
$args=array(
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page'=>-1,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'Date archive of all ' . count($my_query->posts) . ' posts';
while ($my_query->have_posts()) : $my_query->the_post();
$this_date = get_the_time(__('l d F Y'));
if ($this_date != $last_date) {
$last_date = $this_date;
echo '<h2>'.$last_date.'</h2>';
} ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
} //if ($my_query)
wp_reset_query(); // Restore global post data stomped by the_post().
?>
This works beautifully, but displays All Dates. Can someone suggest how I could limit this to last X days? And perhaps also add pagination?