WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar Missing in Posts (8 posts)

  1. Anonymous
    Unregistered
    Posted 6 years ago #

    Hello All.

    My sidebar disappeared the other day after I added my header logo, and some text widgets to the sidebar. I changed the header image in my style.css. I can see my sidebar on the main site: http://lucreziamagazine.com/popmycherry/ as well as pages and categories. But it is missing in individual posts.

    Here is the code I used:

    #header {
    background:url(http://lucreziamagazine.com/popmycherry/wp-content/uploads/2008/07/popmycherry1.jpg) repeat-x top left;
    height: 192px;
    width: 1008px;
    margin:0;
    padding-left:45px;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-weight:normal;
    font-size:0;
    }

    I tried to validate my css and it says it is missing the code : print.css, so not sure if this has anything to do with it.

    I also tried to find an error in the text/html widgets in my sidebar but can't see one.

    Any help would be much appreciated.

    Thank you All in advance!

    DominaDollz

  2. rmk80
    Member
    Posted 6 years ago #

    Hi,

    it looks like you forgot to put the

    <?php get_sidebar(); ?>

    code in your theme's index.php

    Because the

    <div id="sidebar">

    is missing in every post's source, i suppose this is not a style (css) issue but rather a theme issue.

  3. Anonymous
    Unregistered
    Posted 6 years ago #

    Thank you. Where do I put this at? The theme came as is, and I didn't change it. I'll look in the theme and see if I can find it.

  4. Anonymous
    Unregistered
    Posted 6 years ago #

    I just checked and:

    <?php get_sidebar(); ?>

    is included in the theme index.php

    Wonder what else it could be?

  5. Anonymous
    Unregistered
    Posted 6 years ago #

    I just looked at my single post template single.php and it doesn't have the <?php get_sidebar(); ?> in there, just the footer code. Should I add it there?

    Thank you!

  6. rmk80
    Member
    Posted 6 years ago #

    yes, i should have mentioned it, if there is a single.php file in your theme's directory, it will overide index.php, then this is the page responsible for how your post's pages look.

    So all the elements you want to show (like header, sidebar, footer) when viewing a post should be called for in single.php

    Try to copy index.php and rename it to single.php just to see if this fixes your missing sidebar.

  7. Anonymous
    Unregistered
    Posted 6 years ago #

    Thank you. I added the <?php get_sidebar(); ?> code at the bottom of my single.php template and now it works!

    Much obliged!

  8. GadgetStylist
    Member
    Posted 5 years ago #

    Great advice rmk80! Just saved me from an evening of head scratching.

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic