Support » Fixing WordPress » [Plugin: Widget Logic] Condition for front page and single posts NOT working?

  • I have this defined in widget-logic:

    !(is_front_page() || is_single())

    to hide the widget from front page and all posts, and it’s not working.

    heck, even putting !is_single() alone doesn’t work for posts.

    what gives?

    what am I missing here?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Are you wrapping the code you want to exclude with curly braces like this:

    <blockquote>
    if (!is_front_page() || !is_single()) {
      // stuff to exclude
    }</blockquote>

    Plus, you need to make that a valid if statement. Notice the changes I made.

    this is for widget-logic plugin, so that answer doesn’t apply, really… but thanks.

    Oops! Yep, you’re right. Sorry.

    You are hiding from the front page and from all posts, can you instead use is_page() to get what you want?

    crazyzerb, your logic code seems good to me. try the troubleshooting steps on

    http://wordpress.org/extend/plugins/widget-logic/faq/

    Weird, that didn’t help…

    Even setting it to:

    !(is_home() || is_single())

    does absolutely nothing for that widget… and its state depends on the widget above it, somehow, in a weird way.

    if I set the widget above it to

    !(is_home() || is_single())

    as well, everything works fine.

    But if I set the widget above it to

    !(is_home())

    alone, nah, the problematic widget shows up as well.

    Even with the wp_reset_query fix….

    You think it’s the theme coding and its custom widgets?

    could possibly be the custom widgets that you are using. try a basic set up – the default theme with a couple of basic widgets, like the built in text widgets

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Widget Logic] Condition for front page and single posts NOT working?’ is closed to new replies.