Archived topic
Blog add-on: different number of columns on first page
9 replies · Started by Marco on March 1, 2019
Hello
I'd like to have two columns of blog posts on the 1st page and the sidebar and then on the following pages I'd like to have no sidebar but 3 columns of blog posts.
how can I achieve that?
any input is very much appreciated.
Hi there,
Give this a shot:
add_filter( 'generate_sidebar_layout', function( $layout ) {
if ( is_paged() ) {
return 'no-sidebar';
}
return $layout;
} );
add_filter( 'generate_blog_get_column_count', function( $count ) {
if ( is_paged() ) {
return '33';
}
return $count;
} );
Let me know :)
Thanks Tom - those filters seem to work.
What I'm struggling with however is achieving the same height for the column content - I'm using the read more link as a button so it looks kind of strange not having them on the same line within a row.
I'm using the following code so far:
.generate-columns-container,
.generate-columns {
.inside-article {
display: flex;
flex-direction: column;
.entry-summary {
display: flex;
flex-direction: column;
flex-grow: 1;
}
}
}
.read-more-container {
margin-top: auto;
}
what am I missing??
Any chance you can link me to the page?
Hello Tom
I'm currently on localhost - while playing with the css in order to get to equal height columns I think I've figured out what the issue is - the entry footer doesn't always have the same height since the number of tags are different for the posts - some tags go over two or even more lines - if I hide the .tags-links, the above css seems to work - I don't really see a way around this, do you??
Hmm, it's hard to tell without seeing it, unfortunately. Can you show me a screenshot?
Hello Tom
Please find the screenshot here:
or : Open image
Hmm that's strange, I think I'd have to see the issue to fully debug it, unfortunately. Any chance you can throw it up on a temporary live server?
I might be able to put it up on a live server or can give you access locally
Awesome - feel free to send details through our contact form if you'd like: https://generatepress.com/contact
Just be sure to mention this topic :)