• I’m using widget logic on my blog and so far it’s working fantastically except for one thing. I would like a certain widget to display when looking at a particular category and all the posts in that category. In the plugin directory FAQ for widget logic I found this bit of code and put in my own category name as you see

    is_category(nature) || (is_single() && in_category(nature)

    …but when I use it, I get this error message in my sidebar where the widget should appear

    Parse error: syntax error, unexpected ‘;’ in /home/thebirdi/public_html/wp-content/plugins/widget-logic/widget_logic.php(154) : eval()’d code on line 1

    I’m not a coder and this means nothing to me 🙂 Any ideas? (and apologies if it’s just me doing something obviously stupid)

Viewing 4 replies - 1 through 4 (of 4 total)
  • try putting nature inside quotes

    ‘nature’

    Thread Starter Bird

    (@bird)

    Thank you for replying alanft (took me a while to spot that you had)

    I tried what you suggested and had exactly the same error come up, so although I guess forgetting the quotes wasn’t strictly right it wasn’t causing the problem.

    there’s also an end bracket ) missing from the code you quoted, if that’s not a typing error here. should be

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

    Thread Starter Bird

    (@bird)

    Thank you very much alanft, that worked, and now it’s been pointed out I can see it for myself. I think it’s time I learned for myself how all this stuff fits together. Widget logic is great; at last I can have my website just how I want it.

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

The topic ‘[Plugin: Widget Logic] category and category posts error using widget logic’ is closed to new replies.