Archived topic
six number of columns for Blog and Archive pages
11 replies · Started by Immi on June 1, 2021
I want to display blog posts in 6 columns. I used the following snippet that is mentioned here but it's not working for me:
add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
function tu_search_column_count( $count ) {
if ( is_search() ) {
return 16.6;
}
return $count;
}
Hi there,
We would need to use some CSS.
Can you switch from Float to Flex under Customizer > General first?
Done. can you provide me CSS to set blog posts in 6 columns.
Since the site is cached, it hasn't changed to flexbox in font-end yet.
Can you also clear cache and disable the cache plugin?
Yes, I switched from float to flex and also disabled the cache plugin but still blog posts displaying in 5 columns.
Hi there,
try this CSS - i included a rule for tablet as well:
/* Set Desktop columns to 6 */
@media(min-width: 1025px) {
.generate-columns-container .generate-columns.grid-20 {
width: 16.6%;
}
}
/* Set Tablet columns to 4 */
@media(max-width: 1024px) and (min-width: 769px) {
.generate-columns-container .generate-columns.grid-20 {
width: 25%;
}
}
Brilliant, thank you very much🙂
I need one more help from you.
How to move featured image to the left of post title on single pages same as like showing on this page **
In Customizer > Layout > Blog --> Featured Images >> Archives tab, change the Location to Above Title
Changed the location from below title to the above title. Can you provide CSS to align the first paragraph?
And featured Images are showing center in mobile devices and i want to display to next the of the post title.
I want to like this:
1. for mobile devices: **
2. for Desktop: **
For that you would be better off using a Block Element - Page Hero:
https://docs.generatepress.com/article/block-element-page-hero/
Thank you. I'll give that a try!
You're welcome