Homepage › Community Forums › Legacy Theme Support › Portfolio not lining out on the left side
If the the titels one one row of portfolio items are different in length, for example on one, two or three lines, the next row will not line out all the way to the left side. Is there a way to fix this:
Hi guys and girls, since I will change the setting from portfolio to blog I show you a picture so you can see what I mean. Thanks for any help in advance, George
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
Hi Eric,
thanks, replaced the code, but it is no fix, there’s no change in how the portfolio page is being displayed.
Does WordPress have a cache that needs to be cleared?
(I have cleared my browsers cache and I don’t use a caching plugin)
No WP should update it instantly….the only way a cache would need to be cleared is if you’re using a plugin or something…..but hitting your Reload button should do show the latest changes.
Which page is your portfolio again? If you don’t have one, can you create a sample page?
I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com
Hi Eric, thanks so far.
Here is a sample page.
http://www.georgelangenberg.com/homepage/
Add this to your css since the “.clear” class isn’t present –
.clear {
clear: both;
}
I thought you may have already had it in your css, so that should definitely be the last step to get it to clear.
I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com
Eric you have made me very happy. Thank you!
Problem solved :-]
You’re Welcome 🙂
I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com
