- AuthorPosts
- September 27, 2019 at 5:57 pm #30502RachmaninovGuest
I’ve found that the the ‘Default Page’ and ‘Home’ templates have the sidebar disabled, and I know it’s possible to do so for other pages, but I can’t figure out what the code that inserts the sidebar actually evaluates. How can I make a new template in my child theme that has the sidebar disabled?
I’m looking for a way to do this server-side only. Not interested in a CSS solution; this shouldn’t need to be solved with CSS or JS. Ideally, what’s the config option? Header and footer have one, but I couldn’t find documentation for the sidebar config settings.September 30, 2019 at 6:33 pm #30503Jesse OwensGuestHello, thank you for the excellent question, and I’m sorry that our Theme Framework documentation is indeed missing information about how to control the sidebar.
The BoldGrid Theme Framework enables the sidebar, except for the following conditions:
is_page_template( ‘page_home.php’ )
If you’d like to disable the sidebar on other templates or conditionals, you can create a filter, either in your child theme’s functions.php or using a code snippet. In the following example, I’ll demonstrate a function that will disable the sidebar for the is_single() function as well as the custom template my_page_template.php:
function my_custom_theme_configs( $boldgrid_framework_configs ) { $boldgrid_framework_configs['template']['sidebar'][] = "is_single"; $boldgrid_framework_configs['template']['sidebar'][] = "[my_page_template.php]is_page_template"; return $boldgrid_framework_configs; } add_filter( 'boldgrid_theme_framework_config', 'my_custom_theme_configs');
I’ll give a heads-up to our development team to create some better documentation for using the sidebar interface in the BoldGrid Theme Framework. I hope this helps!
- AuthorPosts
- The topic ‘How can I disable the sidebar for a template?’ is closed to new replies.