Reply To: Portfolio not lining out on the left side

Homepage Community Forums Legacy Theme Support Portfolio not lining out on the left side Reply To: Portfolio not lining out on the left side

#7496
Eric
Customer

    Wes is adding an update that fixes this issue soon. Here is the code that will fix it –

    // Outputs clearing div after every 4 posts
    add_action( 'genesis_after_entry', 'portfolio_after_post' );
    function portfolio_after_post() {
        
    	global $wp_query;
        
        // Assumes 4 posts per row
    	$end_row = ( $wp_query->current_post + 1 ) / 4;
            
    	if ( ctype_digit( (string) $end_row ) ) {
    		echo '<div class="clear"></div>';	
    	}
    }

    Just add that in your page_portfolio.php file replacing this code –

    // Clear float using genesis_custom_loop() $loop_counter variable
    // Outputs clearing div after every 4 posts
    // $loop_counter is incremented after this function is run
    add_action( 'genesis_entry_footer', 'portfolio_after_post' );
    function portfolio_after_post() {
        global $loop_counter;
        
        if ( $loop_counter == 3 ) {
            $loop_counter = -1;
            echo '<div class="clear"></div>';
        }
    }

    I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com