Archived topic
Blog Columns Equal Height
7 replies · Started by Leanne on July 29, 2021
Please look at this website. I would like the blog columns to be of equal height.
Can you help me do this?
Thanks!!
Hi Leanne,
We may have to trim the excerpt for the columns to have the same height.
Can you try adding this snippet?
add_filter( 'get_the_excerpt', function( $excerpt, $post ) {
if ( has_excerpt( $post ) ) {
$excerpt_length = apply_filters( 'excerpt_length', 25 );
$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
$excerpt = wp_trim_words( $excerpt, $excerpt_length, $excerpt_more );
}
return $excerpt;
}, 10, 2 );
Here's how to add PHP - https://docs.generatepress.com/article/adding-php/
Hi,
That did not seem to do anything. I am not using excerpts for each post. I have excerpts set to 52 in the customizer.
Hi there,
i can see you have the masonry option enabled ( in Customizer > Layout > Blog ) i assume this isn't required if you want all posts in a row to be the same height ? If so can you disable that and ill take a look at the CSS necessary to force the buttons to be aligned so the posts all look the same height.
Hi,
Ok. I have disabled the masonry option.
Thanks
Now try adding this CSS:
.generate-columns .inside-article,
.generate-columns .inside-article .entry-summary {
display: flex;
flex-direction: column;
flex: 1;
}
.read-more-container {
margin-top: auto !important;
}
.one-container.blog .post:last-child {
padding-bottom: 80px !important;
}
Note this line:
padding-bottom: 80px !important;
the 80px should match any changes you make to the Bottom Padding in the Customizer > Layout > Container.
That worked perfectly.
thank you very much.
Leanne
Glad to be of help