Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30502
    Rachmaninov
    Guest

    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.

    #30503
    Jesse Owens
    Guest

    Hello, 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_404()

    is_search()

    is_front_page()

    is_page_template( ‘default’ ) 

    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!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How can I disable the sidebar for a template?’ is closed to new replies.