0

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?

1 Answer 1

3

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.

2
  • This was exactly it, thank you so much. How can I buy you a beer via the Internet? Commented Oct 7, 2012 at 22:24
  • Good to see you got it solved. Make us happy by giving something back here with answers for other peoples questions.
    – fuxia
    Commented Oct 7, 2012 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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