• Resolved antonlargiader

    (@antonlargiader)


    I added a text widget that I only wanted to appear for material in the subcategory NARS which is category 8. I put the following into the Widget logic box:

    is_category(‘NARS’) || (is_single() && in_category(‘NARS’)

    The widget only appeared on the home page (although the other displays were being handled by the ‘The Event Calendar’ plugin.

    Thinking it was a theme problem I clicked to preview the site in the default theme and saw this where the widget would go:

    Parse error: syntax error, unexpected ‘;’ in /usr/local/4admin/apache/vhosts/bmwra.org/httpdocs/wp/wp-content/plugins/widget-logic/widget_logic.php(161) : eval()’d code on line 1

    Any ideas what is wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • assuming you’ve copied and pasted your code above, there is a ) missing off the end.

    Thread Starter antonlargiader

    (@antonlargiader)

    D’oh!! So simple.

    There’s definitely something funny still going on with refresh, though. I edited it, fixed the error, then when I went back to edit the widget text the old widget_logic value got saved again. Hitting refresh at the right moment fixes it but it’s certainly not doing exactly what one would expect.

    But, it’s working!

    Thread Starter antonlargiader

    (@antonlargiader)

    In my defense, I simply copied that string from the bottom of the FAQ and edited the values. So you might edit that FAQ.

    ha ha, yes! i will! thanks ??

    “I edited it, fixed the error, then when I went back to edit the widget text the old widget_logic value got saved again”

    let me check on this – my install is subtly different…

    i’m definitely not seeing that the way i change stuff and save. if you can replicate this and give me click by click directions, i’ll see what i can find.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Widget Logic] Parse error’ is closed to new replies.