WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Twenty Eleven Sidebar Template not working (27 posts)

  1. zerpex
    Member
    Posted 3 years ago #

    Hello guys and girls!

    I'm sitting here with my Site, and want the frontpage to be one-column, I go to Theme Options, set default Template to One-Column, go to all my other pages, and set the Template to Sidebar Template.. When I then view the other pages, They doesn't have a sidebar for some reason.

    Do anybody know how to fix it?

    Best regards,
    Lucas

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

    For this reason, it is recommended that you consider creating a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  3. zerpex
    Member
    Posted 3 years ago #

    Seems like it's a standard post Esmi..

    So I'm wondering, the Twenty Eleven Theme in wordpress is for no use? - We can't even use it as a blog? Is it just installed for taking space.. Because seems like we may not use it for our website.. Even without changing the theme code..

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Please try reading my previous post.

  5. zerpex
    Member
    Posted 3 years ago #

    I can say so much, that I'm running a Child version of Twenty Eleven - And the problem is that the sitebar template ain't working if I have one-column as default layout.. Then I can't set sidebar template for other sites ;)

  6. bartsurminski
    Member
    Posted 3 years ago #

    I've created a workaround by editting 2 files (or 3 if you want the sidebar on single-post sites as wel.

    Check out: http://surminski.eu/2011/07/06/add-sidebar-to-single-post-in-the-wordpress-3-2-twentyeleven-theme/

    Pls comment on my post if you have any questions/remarks.

  7. zerpex
    Member
    Posted 3 years ago #

    Hello Bartsurminski!

    That I have, is I'm having 5 pages, Like etc Home, About Us, and Contact - I want the Home to be a onecolumn page, with no sidebar, and the others should have a Sidebar, but when I set onecolumn-page as default in the admin panel, it aint working with the sidebars on the other pages. - I'll take a look on your site!

  8. bartsurminski
    Member
    Posted 3 years ago #

    You might be able to remove the get_sidebar statement from index.php in the editor.

    Open index.php in the editor (under appearance)

    Change

    </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    In:

    </div><!-- #primary -->
    
    <?php get_footer(); ?>

    Then click 'update file'

    I haven't checked it myself if it works, so please backup your index.php.
    Hope it helps

  9. zerpex
    Member
    Posted 3 years ago #

    At least it removed the sidebar - Do you know any way, when you inspect the body tag, it says two-column - if I change that class to one-column, it works as it should - But I can't find anywhere, where it writes two-column to the body tag for the frontpage

  10. Niraj Chauhan
    Member
    Posted 3 years ago #

    The easiest way to get the sidebar on single.php or post page is to install a Child Theme of 2011 theme,
    You can download the theme from here
    http://webstutorial.com/add-sidebar-twentyeleven-theme/content-management-system-cms

  11. Rohit Tripathi
    Member
    Posted 3 years ago #

    You Can Do these changes without using any child theme. Here is What You have to Do.

    Add Sidebar TO Single Post Pages in Twenty Eleven

  12. zerpex
    Member
    Posted 3 years ago #

    Thank you both, I got everything fixed now.. :)

  13. abdumayet
    Member
    Posted 3 years ago #

    Hey Guys,

    I lost some code in header.php and I need it back. It is specifically the H2 tag for the site description near line 108 I think. I lost the whole H2 tag and now my site description doesn't show up. Can anybody paste the code over here for me? Thanks.

    - AM

  14. bartsurminski
    Member
    Posted 3 years ago #

    Don't know the Line number, but i suppose it's this piece: (only part with H2 in it)

    <body <?php body_class(); ?>>
    <div id="page" class="hfeed">
    	<header id="branding" role="banner">
    			<hgroup>
    				<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    				<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</hgroup>
  15. abdumayet
    Member
    Posted 3 years ago #

    Thanks dude! That worked. Also, do you know how I can align my fb login button to the right under the search bar?

  16. bartsurminski
    Member
    Posted 3 years ago #

    Must say i'm not that into php, copy paste of code is something i'm able to, aligning tables is another story ;)

  17. abdumayet
    Member
    Posted 3 years ago #

    hahaha much like my abilities. thanks anyway!

  18. zerpex
    Member
    Posted 3 years ago #

    Honestly I'm wondering, how can this be a part of this topic?

  19. Niraj Chauhan
    Member
    Posted 3 years ago #

    Hey after a long digging, finally I am ready with Twenty Eleven Child Theme which enables sidebar not only on posts, but also on pages

    So only one child theme, which will get sidebar on the entire site

    http://webstutorial.com/wordpress-twenty-eleven-theme-sidebar-pages-posts/content-management-system-cms

  20. Rendo
    Member
    Posted 2 years ago #

    @ Niraj Chauhan: it finally works! thx

  21. hwilke01
    Member
    Posted 2 years ago #

    Hey folks- I created a child theme based on the Twenty Eleven them... but for some reason a few features aren't working. Specifically, the right column doesn't want to add anything I add to it in the widgets area.

    http://www.transactioncoordinator.net

    Any ideas why? Is there something special I need to do when creating a child theme other than copying and renaming the theme title in the style.css? Many thanks in advance.

  22. alchymyth
    Forum Moderator
    Posted 2 years ago #

    @hwilke01
    have you edited page.php and added <?php get_sidebar(); ?> before the 'get_footer' line?
    or assigned the 'sidebar template' to that page?

  23. hwilke01
    Member
    Posted 2 years ago #

    No I haven't. Should I? Will that fix it?

  24. alchymyth
    Forum Moderator
    Posted 2 years ago #

    No I haven't. Should I? Will that fix it?

    that will hopefully fix your problem.

  25. hwilke01
    Member
    Posted 2 years ago #

    @alchymyth thanks for the help. Adding that line to the pages.php added the content from the sidebar text widget, but it isn't placed properly. Take a look: http://www.transactioncoordinator.net

    Any ideas? (and thank you for your help)

  26. alchymyth
    Forum Moderator
    Posted 2 years ago #

    unfortunately it is not that simple in twenty eleven;
    have a look in here http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages

    or, possibly easier, as Twenty Eleven already comes with a ready made page template for pages with sidebar, remove the <?php get_sidebar(); ?> again from page.php,
    and use the 'Sidebar Template' for that page (page ID 128) under dashboard -> pages -> edit page -> attributes - page template

  27. Libin
    Member
    Posted 2 years ago #

    Thank you so much bartsurminski.
    It works perfectly. Actually I’ was in a big trouble how to solve this. I was thinking about to switch back to twentyten theme. But your tutorial to add sidebar helped me.

    Thank you so much Bart. Cheers :)

Topic Closed

This topic has been closed to new replies.

About this Topic