• I try to do this:
    I just want a widget to be displayed on 1 category page, then the rest of the pages shouldn’t display anything (and this worked out fine, that’s pretty simple).

    But the rest of the category pages (where there are no widgets) should be in full width, and this isn’t the case. They are still making space for the sidebar, even though there nothing there.

    Since I’m not a coding wiz, I asked Justin Tadlock if was a problem with one of his themes that I’m using, but according to Justin:

    It’s because the plugin doesn’t “deactivate” the widgets while on that page. They’re still being read as active by WordPress.

    I also posted this here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • alanft

    (@alanft)

    ok – i’m not going to count that as a bug. If i understand it’s a shortcoming of the general idea which is just as Justin describes.

    to adapt your post title “Widget-logic doesn’t “deactivate” SIDEBARS on sidebars without widgets”

    assuming that your CSS correctly responds to the absence of a sidebar – you still have to work out how to get the sidebar HTML to vanish entirely, which Widget Logic can’t do – as it depends on your theme. so if (for example) your category.php or index.php or whatever does a normal get_sidebar(); your sidebar.php might look typically something like

    <ul id="sidebar"><?
    if (function_exists('dynamic_sidebar')) dynamic_sidebar();
    ?></ul>

    and widget logic only steps in at the dynamic_sidebar(); step. By which time you are already committed to the UL block, or something like that.

    what you have to do is work out how to not get that called in the first place.

    right now I can’t think of a sensible way for WL to step in and do that for you. Sorry.

    You could change the call to get_sidebar(); so that it’s something like

    if (is_category() &amp;&amp; !is_category(Y))
    	get_sidebar();
    alanft

    (@alanft)

    in case it’s not obvvious, the crazy forum code changed my code there. that should just be a double ampersand in the if statement

    Thread Starter Thomas Clausen

    (@tntc1978)

    OK thanks for the fast reply. I’ll give your work-around a go instead.

    Thanks for a impossible-to-live-without plugin.

    I don’t consider this a bug with the plugin, and I definitely don’t know if there’s a way to change it. I’ve been playing around with how to deactivate a specific sidebar though. You can see my notes here:
    http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates

    The theme in this case would automatically knock out the surrounding HTML if the sidebar wasn’t active, thus resulting in a full-width page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Widget Logic] Widget-logic doesn’t “deactivate” widgets on sidebars without widgets’ is closed to new replies.