Check posts dates against other posts to find the 4 most recent
-
Hello,
I am trying to query the posts to establish the four most recent posts and then display them in different places in a template. Anyone have any ideas how to do this? I have tried
<?php $recentpost = new WP_Query("showposts=1"); while($recentpost->have_posts()) : $recentpost->the_post(); ?> <?php $newest_date = get_the_date( $d ); ?> <?php echo "$newest_date";?>// for troubleshooting <a href="<?php the_permalink(); ?>">featured Image <div class="post-title-bg"><?php the_title(); ?><br/> <?php the_excerpt(); ?> </div></a> <?php endwhile; ?>
This I believe will give me the newest post. But how can I find the 3 most recent after that and display them not in a list, but in different spots? Any reading or help is appreciated.
thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Check posts dates against other posts to find the 4 most recent’ is closed to new replies.