Widget Logic
[resolved] Causes PHP error (4 posts)

  1. pastorjim
    Posted 3 years ago #

    My PHP error log shows lots of the same error: PHP Parse error: syntax error, unexpected ';' in widget_logic.php(284) : eval()'d code on line 1
    I've checked my widget logic code and don't see a problem, though there could be one.

    ----My Bad. I DID find an extra "(" in one of my widget logic conditions. All is good now.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Site url? It's possible that your site has been hacked.

  3. Mike
    Posted 3 years ago #

    I'm having a similar error after the host updated PHP from 5.2.17 to 5.3.21.

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ')' in /home/user/public_html/wp-content/plugins/widget-logic/widget_logic.php(284) : eval()'d code on line 1

    I notice that I had my is_page conditionals like this: is_page('42')
    I see here that I should not have the apostrophes in there. (Strange that it always worked fine that way, though.

    Anyway, on that link, it's hard to tell but it looks like there's a space between the ( and the number, like this: is_page( 42 ) Is that correct, or should it be like this: is_page(42) ?

  4. Mike
    Posted 3 years ago #

    OK, I was able to clear the issue. In case it helps anyone else, it turns out the is_page conditional will work with or without apostrophes, and with our without spaces. It wil not, however, work with just one apostrophe! I had one conditional statement like this: is_page('42)

    The fix is either to add the closing apostrophe or delete the opening one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.