Config.php Template Condition

I have a custom page template called page-trainers.php to override the default page template.

That’s working perfectly, but I’m try to get that page to be full width. Here’s the config.php condition I have set but cannot get to work.

function roots_display_sidebar() {
  $sidebar_config = new Roots_Sidebar(
     * Conditional tag checks (
     * Any of these conditional tags that return true won't show the sidebar
     * To use a function that accepts arguments, use the following format:
     * array('function_name', array('arg1', 'arg2'))
     * The second element must be an array even if there's only 1 argument.
     * Page template checks (via is_page_template())
     * Any of these page templates that return true won't show the sidebar

  return apply_filters('roots_display_sidebar', $sidebar_config->display);

I created a base-page-template.php and altered the main containers class to be full width but that’s a work around. I’d like to know how to do this config.php.


Did you mean base-page-trainers.php? If not then the reason the conditional is not working is because the page being loaded is page-custom.php not page-trainers.php.

@Foxaii, that’s correct. It was my mistake in labeling.

I was able to correct it with config.php and I was also able to create a new base page before I figure that one out. Both worked but the first was a much cleaner approach.