• Resolved linzinz

    (@linzinz)


    I have seen many posts about sidebar issues but can’t find the answer to my problem!

    I have a static home page, a blog page and some other static pages.
    The home page has to be without a sidebar but the other static pages need to have a sidebar. Changing to sidebar template on those pages isn’t working for me.

    I have a child of twenty eleven theme.

    Any suggestions please?

Viewing 12 replies - 1 through 12 (of 12 total)
  • You need to create a modified page.php template file in your child theme that calls get_sidebar().

    Thread Starter linzinz

    (@linzinz)

    So do I copy the whole of the page.php file into the child theme?
    Where does the get_sidebar() go in the code?

    So do I copy the whole of the page.php file into the child theme?

    To start with, yes. This will be the file that you will modify.

    Where does the get_sidebar() go in the code?

    Near the bottom. Check the parent’s index.php template file for the exact positioning.

    Thread Starter linzinz

    (@linzinz)

    Thanks esmi, problem is that I tested it by adding a meta widget and it ended up way down the page (something to do with me changing widths etc?) but now it won’t go away at all. It is also on the home page and I don’t need a sidebar on that page. Hope you can help!

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

    Thread Starter linzinz

    (@linzinz)

    OK the site is very much under construction though.

    Thread Starter linzinz

    (@linzinz)

    You will need to create a page template – without the sidebar call – in the child theme for the home page. Call the new template front-page.php and WP will automatically apply it to your static front page.

    As for the dropping sidebar, can we see a Page with one of these sidebars added?

    Thread Starter linzinz

    (@linzinz)

    This page is using the sidebar template https://www.lollipopportraits.co.nz/wordpress/about-us/
    You can see if you scroll down that the admin and login widget that I put in to test and then deleted is still there and won’t go away. If I try to put in any text widget it ends up in the same place as this. It needs to be at the top on the right.

    What code needs to go into the front-page.php is it everything from page.php without the sidebar call of course?

    Thread Starter linzinz

    (@linzinz)

    Managed to get the admin widget to go by replacing it with a blank text widget. However any widget I put in its place is still displaying at the bottom of the content.

    If I reduce the primary div width the sidebar content moves to where it should be. Trouble is I have a transparent page because I want the logo at the top (a png) to show the main background underneath it. I need all the rest of the page to have a white background. With the sidebar on the right of content.

    Hope this makes sense! Grateful for any suggestions…

    In twenty ten the container for the main content has a negative margin to make room for the right sidebar. Sidebar is 220px wide in this case.

    #container {
    	float: left;
    	margin: 0 -240px 0 0;
    	width: 100%;
    }

    I found it a trick used to keep the code in the same order for non-css reading devices.. for accessibility. Twentyeleven may use the same thing.
    give the main content that css with enough margin for your sidebar and it may pop right up into place. I broke mine.. then learned that trick.

    Thread Starter linzinz

    (@linzinz)

    Thanks mrtaylor!
    That worked, although in Twenty Eleven I changed the margin to negative on the #primary

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘twenty eleven – sidebars on static pages’ is closed to new replies.