WordPress: Split posts by date

Splitting posts by date is hand for blog or article WordPress sites and segments posts making it easier to navigate/scroll through posts chronologically. In particular segmenting posts by date is handy for the homepage, category pages and/or tag pages.

So depending on how your theme works, you will need to edit your theme in order to split the posts by date. So for example on the The Web Taylor Help site, the homepage demonstrates this technique. So the loop on the index.php file should look similar to this:

<?php 
	if ( have_posts() ) {
	while ( have_posts() ) : the_post(); 
?>
	<div class="post" id="post-<?php the_ID(); ?>">
		<?php the_date('jS F Y', '<div class="date_wrap"><span class="the_date"><span>', '</span></span></div>'); ?>
		<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo $featured; the_title(); ?></a></h2>
		<?php the_excerpt(); ?>
	</div>
<?php 
	endwhile;
	} 
?>
Free Graphics, Icons, Tutorials
Free Graphics Free Christmas Vector Icon Graphics Pack 2017Free Fitness Vector Icons Graphics PackFree Camping Vector Graphics PackFree Summer Graphics PackFree File Icon PackFree Fast Food Vector Graphics
Sharing is caring...
Like & Follow
Share the love, share this page! Facebook Twitter Digg Reddit LinkedIn Pinterest Email
Close [X]
The Web Taylor
1000 Lakeside North Harbour Portsmouth, Hampshire PO6 3EN
02392 123358