Reply To: Changing the Order of the Posts

Homepage Community Forums Agile Theme Support Changing the Order of the Posts Reply To: Changing the Order of the Posts


    Currently the max-width for the #wrap is 1250px, which would fit about 6 images in a row. You could increase or decrease this number if you wanted to, but it will change the width of your entire site as well.

    Another option – In my other themes, I have code that adds a clear: both; after a certain number of posts…….in other words, it does exactly what you are asking for, and you control at which number/post everything starts over and creates a new row.

    You can add this to your home.php file and it should work (adjust the loop counter number if needed) –

    // Remove standard loop
    remove_action('genesis_loop', 'genesis_do_loop');
    // Clear float using genesis_custom_loop() $loop_counter variable
    // Outputs clearing div after every 5 posts
    // $loop_counter is incremented after this function is run
    add_action('genesis_after_post', 'portfolio_after_post');
    function portfolio_after_post() {
        global $loop_counter;
        if ( $loop_counter == 4 ) {
            $loop_counter = -1;
            echo '<div class="clear"></div>';