• 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

    (@jcastaneda)

    THEME COFFEE MONKEY

    Are you able to provide a link?

    What is the code you are using?

    Thread Starter Shevylinks

    (@shevylinks)

    Hi Jose

    Thanks for the reply. My website is https://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.]

    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.