Title: Group Post by date loop help!
Last modified: August 21, 2016

---

# Group Post by date loop help!

 *  [Shevylinks](https://wordpress.org/support/users/shevylinks/)
 * (@shevylinks)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/group-post-by-date-loop-help/)
 * Hi
 * I finally managed to group my Posts by date on the homepage.
 * I just added: <p><?php the_date(); ?>
    </p> To my index.php. This is great!
 * But now I have run in to a slight issue which I really hope someone can help 
   me with!
 * I want ‘New dated posts’ to allways start on a new row.
    e.g.
 * > November 5, 2013
   >  -post -post -post -post -post -post
   > November 4, 2013
   >  -post -post -post -post -post -post
 * At the moment it looks like this:
 * > November 5, 2013
   >  -post -post -post ——-November 4, 2013 -post -post -post
   > ————-November 3, 2013
   >  -post -post -post -post -post -post
 * This is because some second row or third row posts have different dates.
 * If anyone can help fix this that would be great!
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [12 years, 7 months ago](https://wordpress.org/support/topic/group-post-by-date-loop-help/#post-4292790)
 * Are you able to provide a link?
 * What is the code you are using?
 *  Thread Starter [Shevylinks](https://wordpress.org/support/users/shevylinks/)
 * (@shevylinks)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/group-post-by-date-loop-help/#post-4292813)
 * Hi Jose
 * Thanks for the reply. My website is [http://www.posted365.com](http://www.posted365.com)
 * the code i am using in index.php is:
 *     ```
       <?php get_header(); ?>
   
       	<?php if(!is_paged() && (get_option('videopro_featured_slider_enable') == 'on')) { ?>
   
       		<?php get_template_part('includes/featured-slider'); ?>
   
       	<?php } ?>
   
       	<div id="content">
   
       		<?php  get_template_part('includes/breadcrumbs'); ?>
   
       	    <article>
   
       		    <?php
       		        $count = 1;
       		    ?>
       			<?php if (have_posts()) : while ( have_posts() ) : the_post() ?>
   
       		<p><?php the_date(); ?></p>
   
       		    	<?php include('includes/loop.php'); ?>
   
       		        <?php if ( $count%3 == 0 ) { ?>
   
       		            <div class="clear"></div>
   
       		        <?php }; $count++; ?>
   
       			<?php endwhile; ?>
   
       		    <div class="clear"></div>
   
       	    </article><!-- article -->
   
       		<div class="pagination">
   
       			<?php pagination( '« prev', 'next »') ?>
   
       		</div><!-- .pagination -->
   
       		<?php else : ?>
   
       		<?php endif; ?>
   
       	</div><!-- #content -->
   
       <?php get_sidebar(); ?>
   
       <?php get_footer(); ?>
       ```
   
 * _[Moderator Note: Please post code & markup between backticks or use the code
   button. Your posted code may now have been permanently damaged by the forum’s
   parser.]_
 *  [dunskii](https://wordpress.org/support/users/dunskii/)
 * (@dunskii)
 * [12 years ago](https://wordpress.org/support/topic/group-post-by-date-loop-help/#post-4293057)
 * Hi Shevylinks
 * Just wondering what you solution to this was.
 * Cheers,
    D

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Group Post by date loop help!’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * 3 replies
 * 3 participants
 * Last reply from: [dunskii](https://wordpress.org/support/users/dunskii/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/group-post-by-date-loop-help/#post-4293057)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
