i am searching for a method to code the loop in a way it places posts which are in within 24 hours inside a div. Im carrying this out in order to put a separator between your different days to exhibit customers that they're searching at a later date. A good example of this for action is within informedlondon.com, where when a days price of posts finishes, there's just a little graphic among to split up the posts. This is exactly what Google's Blogger platform does automatically, for this reason it had been simple for the divider to become put between your different times of posts.

I am speculating there has to be a tutorial about this somewhere however i have checked and should not appear to locate one. I've got a sneaky suspicion that it is easy and i am just as being a dunce. Would appreciate outside assistance.

Thank you ahead of time.

The easiest approach to accomplish such things as this really is to 'hold' the present date inside a variable. Before your loop: var $current_date after which within your loop, an easy if statement:

if( $current_date != get_the_date('d-m-Y') ){
    echo '<h2>Posts for '.get_the_date('d-m-Y').'</h2>';
    $current_date = get_the_date('d-m-Y');

So essentially, you are checking with every publish if the date from the publish differs from the date from the last publish made (within the 'holding' variable, $current_date). If it's, you print a title using the new date, and hang the 'holding' variable towards the new date. Otherwise, nothing happens and also the publish is printed as always.