• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Appfinite

Appfinite

Premium WordPress Themes for The Genesis Framework

  • Themes
  • Blog
  • Tutorials and Resources
  • Forums
  • Contact Us

Reply To: Portfolio not lining out on the left side

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

September 19, 2013 at 12:00 pm #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

Primary Sidebar

Search Forums

Affiliate Program

Looking to earn some money? Join our Affiliate program and earn 35% of every sale you refer. Top referrers earn 40-50%.

Join Now →

The Genesis Framework

All of our themes are designed for the Genesis Framework. You will need to purchase Genesis in order to use any of our themes.

Purchase Genesis

Hire a Web Developer

Need help setting up or customizing your website?

Contact Us →

Search Full Site

  • Buy Genesis!
  • Shopping Cart
  • Themes
  • My Account
  • Support Forums
  • Tutorials and Resources
  • Privacy Policy
  • Contact Us
  • Follow Us on Twitter

Copyright © 2023 · Appfinite · Built With The Genesis Framework