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.

On Twenty Eleven or on its child themes the default template for new pages is a template with no sidebar. I don't know why this is like this; it seems to me that the designers of Wordpress are still not thinking about CMS functionality in some places.

For example the most obvious place to put a menu in a CMS is the sidebar. But with Twenty Eleven the only way to show a menu in all pages is to explicitly set all the pages to "sidebar template". I would think it's a design bug, as the only solution so far is to tell everyone to "don't forget to set the new pages to "sidebar template"".

I'm sure there must be a single line in functions.php which changes the default action but I don't know what that line is. Could you tell me what should I write in functions.php to set all new pages to "sidebar template" when using Twenty Eleven?

I'm sure that it has been asked before but I really couldn't find it anywhere using the search function.

share|improve this question
add comment

1 Answer

just add <?php get_sidebar(); ?> to page.php in your child theme and all pages will have a sidebar. look at sidebar-page.php to see where to place it.

share|improve this answer
    
OK, but then I am modifying page.php. Isn't there a way to keep it minimalistic for the child theme, thus preserving all future updates to page.php? –  zsero Oct 10 '11 at 16:29
    
@zsero - you can hook save_post and add post meta with key _wp_page_template and sidebar-page.php as value. or I suppose you can add some javascript to the post edit screen that auto-selects a template. –  Milo Oct 10 '11 at 16:52
    
This will brake the site's design unless you play around with the CSS and the position of the article. –  jnns Mar 6 '12 at 10:13
add comment

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.