WordPress.org

Ready to get started?Download WordPress

Forums

Widget Misbehaving, Shows Widget AND "default" Sidebar Contents (4 posts)

  1. Joni
    Member
    Posted 6 years ago #

    I am hoping this is just a WP version issue. I am working on a new theme. In the past, to widgetize a sidebar, you would add something like this right before the opening <ul>:

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>

    And you'd add this right after the closing </ul>:

    <?php endif; ?>

    I notice now, however, that WP throws out errors when it encounters that last <?php endif; ?>. When you remove it, things settle down. Except for one thing:

    As you can see from the testbed, it throws EVERYTHING into the sidebar, the original contents AND the widgets.

    http://wordpress.mytestbed.com

    I know this is because of that missing line of code at the end, but what is the fix? I've Googled and searched these forums. Any thoughts/ I wanted to widgetize this theme before releasing it, but personally, I don't care for them so.. anyway, if anyone has any ideas, I'm all ears.

    Thanks!

  2. Joni
    Member
    Posted 6 years ago #

    I hope I don't get into trouble for BUMPing this; hasn't anyone else run into this problem? It's maddening.

  3. moshu
    Member
    Posted 6 years ago #

    Is there any other conditional (if) in that sidebar that might mess with the one required by the "widgetization"?

  4. Joni
    Member
    Posted 6 years ago #

    Not that I can see unless it's being called in from somewhere else independent of this code, but it doesn't look like it. Thanks for any assistance.

    Code is here:

    http://wordpress.pastebin.ca/684488

Topic Closed

This topic has been closed to new replies.

About this Topic