Support » Themes and Templates » [Twenty Eleven] Sidebar shifted in custom template

  • Resolved nkosazana

    (@nkosazana)


    Hi,

    I created a custom template for my home page. All I did was add a div for a banner at the top before any other content because I wanted it to be full width. Then, the sidebar shifted downwards under the entry-content. It’s still set to float:right; can someone please help me get it into the normal position? Here is the code for my custom template:

    [code moderated – use the pastebin for any code over 10 lines]

    This is the url: bit.ly/Izo5Wx

    Please help! Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    please create a child theme to work with http://codex.wordpress.org/Child_Themes

    I wrote this post about the correction:

    Twenty Eleven – New Page Template with Sidebar Correction

    Hi,

    Thank you. I created the child theme. When I preview it, it does not display. Instead I get this message:

    Fatal error: Cannot redeclare twentyeleven_excerpt_length() (previously declared in /home/themessa/public_html/wp-content/themes/messagetheme/functions.php:318) in /home/themessa/public_html/wp-content/themes/twentyeleven/functions.php on line 320

    Michael

    (@alchymyth)

    Forum Moderator

    you cannot copy the full functions.php into the child theme.

    it is a bit complicated, but just implement, what you want to change, into the new functions.php of the child theme.

    Thanks, it worked but I wanted the side bar and entry-content under my banner image, but they are colliding. How can this be corrected? I’ve tried clear:both on my banner div.

    Michael

    (@alchymyth)

    Forum Moderator

    the banner is sticking out over the boundaries of the content area which is causing the problem.

    you can fix this by adding something like this line to style.css:

    .page-template-newhome-page-php #secondary { margin-top:340px; }

    Hi,

    Thanks. I tried that but it didn’t work. When I check the CSS for the sidebar div in my template, this is what I get:

    <div id="secondary" class="widget-area" role="complementary">

    That’s probably why.

    When I modify the #secondary in dragonfly, it moves to the ideal position, but the #secondary applies to all sidebars and I don’t want all my sidebars to be that low. I tried creating a new sidebar which I registered in functions.php and added to my new template but when I checked it in dragonfly, it was not picking up my new style for the div #newhome-secondary. Could you please help me. Thank you.

    This is the link to a page which uses the template: bit.ly/IWVk4m

    Michael

    (@alchymyth)

    Forum Moderator

    When I modify the #secondary in dragonfly, it moves to the ideal position, but the #secondary applies to all sidebars and I don’t want all my sidebars to be that low.

    that is why my suggested style had the template css class with it.

    I first tried it with the template class but there was no change (see link).

    Michael

    (@alchymyth)

    Forum Moderator

    find this in style.css:

    #contact {
    	color: #fff;
    	float: left;
    	width: 30%;

    and see that the closing } is missing – this could have stopped all other styles further down from getting applied.

    fix this, and re-try with clearing the browser cache…

    Thanks for pointing that out. I tried your suggestion with no change. Thank you for all your help.

    Michael

    (@alchymyth)

    Forum Moderator

    it is working on my side in Firefox

    – clear the browser cache to get the changes to show in your browser – details will depend on the browser, but try ‘reload’ a few times, or press ‘CTRL F5’ …

    Thanks a million! It’s working.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Twenty Eleven] Sidebar shifted in custom template’ is closed to new replies.