WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Twenty Eleven] Sidebar shifted in custom template (14 posts)

  1. nkosazana
    Member
    Posted 1 year ago #

    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

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

  3. nkosazana
    Member
    Posted 1 year ago #

    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

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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.

  5. nkosazana
    Member
    Posted 1 year ago #

    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.

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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; }

  7. nkosazana
    Member
    Posted 1 year ago #

    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.

  8. nkosazana
    Member
    Posted 1 year ago #

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

  9. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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.

  10. nkosazana
    Member
    Posted 1 year ago #

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

  11. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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...

  12. nkosazana
    Member
    Posted 1 year ago #

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

  13. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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' ...

  14. nkosazana
    Member
    Posted 1 year ago #

    Thanks a million! It's working.

Topic Closed

This topic has been closed to new replies.

About this Topic