Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the Roots WP Theme and for some reason when copy pasting the page-custom.php to create a home page template. The new homepage template is showing the sidebar but not the original page-custom template even though the two template files are exactly the same at this moment.

Can anyone explain why this might be?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Look at the config.php:

function roots_display_sidebar() {
  $sidebar_config = new Roots_Sidebar(
    /**
     * Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
     * Any of these conditional tags that return true won't show the sidebar
     */
    array(
      'is_404',
      'is_front_page'
    ),
    /**
     * Page template checks (via is_page_template())
     * Any of these page templates that return true won't show the sidebar
     */
    array(
      'page-custom.php'
    )
  );

  return $sidebar_config->display;
}

So if your home is not the front page the sidebar will be displayed. There is probably a way to adjust these settings per filter, but you can also just change the first array to …

    array(
      'is_404',
      'is_front_page',
      'is_home'
    ),

… to hide the sidebar.

share|improve this answer
    
This was exactly it, thank you so much. How can I buy you a beer via the Internet? –  dalanmiller Oct 7 '12 at 22:24
    
Good to see you got it solved. Make us happy by giving something back here with answers for other peoples questions. –  toscho Oct 7 '12 at 22:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.