Archived topic
Columns only on homepage
3 replies · Started by Former User on December 3, 2018
Hello GP team,
have layout of the blog set to 3 columns. I only want to show columns on the homepage, not in the archive, categories and tags. Is there a matching CSS command.
Thanks for your help ...
Greetings Uwe
Hi their,
you can use the blog options filter:
https://docs.generatepress.com/article/option_generate_blog_settings/
instead of the is_search() you can target the is_archive()
Hi David,
Thank you for your prompt reply. Can not do it unfortunately - do not know me in PHP, etc. not. Is there not a way that I can solve that with "Adding CSS".
Thanks for a tip
Greetings Uwe
Not possible with CSS.
Try this PHP snippet:
add_filter( 'option_generate_blog_settings', 'lh_disable_columns' );
function lh_disable_columns( $options ) {
if ( ! is_home() ) {
$options['column_layout'] = false;
}
return $options;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/