Archived topic
Change Archive Page to 3 Columns and Remove sidebar
7 replies · Started by Alan on February 27, 2021
I have an archive page for my CPT (Tours) that is displaying posts in a single column see here https://www.savacations.com/tours/. I was able to remove the sidebar using elements/layout. I would like to change the layout to 3 columns similar to mys search results page here https://www.savacations.com/?s=chile. How do I do that?
It is ok to keep the tour meta in place (title, duration, excerpt).
Please let me know.
Thanks,
Hi Alan,
Have you tried the settings in customizer > layout > blog > Columns?
Let me know :)
Yes, the number of columns for that archive page is not adjustable from the customizer...I am already using three columns for the blog archive pages (see here https://www.savacations.com/category/south-america-travel/).
Not sure if it maters or not, but this is an archive page for a CPT.
Leo:
Please forgive me, but I am not a developer.
This is what I am using, but it is not working...
add_filter( 'generate_blog_columns','arc_tours_columns' );
function arc_tours_columns( $columns ) {
if ( is_post_type_archive( 'tours' ) ) {
return 33;
}
return $columns;
}
Can you add this code?
add_filter( 'generate_blog_columns','tu_portfolio_columns' );
function tu_portfolio_columns( $columns ) {
if ( is_post_type_archive( 'tours' ) ) {
return true;
}
return $columns;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Make sure your caching plugin is cleared.
Leo:
That worked perfectly...
Thanks!!
No problem :)