• Okay, I’ve been working on a website for a client, and She just asked me to have two separate sidebars, one for her blog and another for the rest of her site. So I went and created the second sidebar and updated the functions accordingly. The good news is that both sidebars show up on my widgets page, but the bad news is that neither sidebar appears on any of the web pages. there’s just a blank space where my sidebar is supposed to be.

    here is the code for my functions:

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array( 'name' => 'Main Sidebar',
    'id' => 'main_only',
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '</li>',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>', ));
    
    if ( function_exists('register_sidebar') )
    register_sidebar(array( 'name' => 'Blog Sidebar',
    'id' => 'blog_only',
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '</li>',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>', ));
    ?>

    furthermore, here is the code for one of my sidebars.

    <div id= "sidebar">
    &nbsp<br>
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘blog_only’) ) : ?>
    <?php endif; ?>
    &nbsp<br>
    </div>

    the actual site can be found at http://quanwilliams.com/freelance

    the only code I have on the page templates regarding the sidebar is this:

    <?php get_sidebar('sidebar-blog.php'); ?>

    So what am I doing wrong? I’m kinda on a deadline so I really need to know the solution ASAP. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • 1. Try looking at the bottom of your pages.
    2. Have you created the appropriate sidebar-xx.php template files?

    Thread Starter quannage

    (@quannage)

    yeah. I have both ‘sidebar’ and ‘sidebar-blog’ ready to go. Here is the code for ‘sidebar-blog’.

    <div id= "sidebar">
    
    &nbsp<br>
    
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘blog_only’) ) : ?>
    <?php endif; ?> 
    
    &nbsp<br>
    </div>

    at the bottom of my pages all I have is this:

    <?php get_sidebar('sidebar-blog.php'); ?>
    
    <?php get_footer(); ?>
    </div>
    </div>

    Have you looked at the bottom of your generated pages on the site?

    Thread Starter quannage

    (@quannage)

    in the code, or on the actual site?

    I’m missing something, aren’t I?

    On the site. Your (empty?) sidebar is being displayed at the very bottom of your pages.

    Thread Starter quannage

    (@quannage)

    On my browsers it’s not showing up at all. the white text on brown at the bottom is the footer.

    Try using Firefox with the Firebug add-on. Or use whatever developer tool is available in your web browser.

    Thread Starter quannage

    (@quannage)

    Ah, you think the problem is with my CSS. I’ll look into it.

    Given that you’re using table mark-up for layout purposes (which is a big “no-no” in web design generally), it’s difficult to determine whether this is a pure CSS issue or whether you also have some problems with your mark-up.

    Thread Starter quannage

    (@quannage)

    Yeah, about that….
    The table was honestly the only way I could get the nav menu to look the way I wanted it to. It was literally my last resort, because nothing else worked. but I guess that’s something I can cover with another topic…

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Sidebar vanished’ is closed to new replies.