Support » Fixing WordPress » Parse error with json – WP update

  • madsenand

    (@madsenand)


    Dear WP experts,

    I’m new to WP, and I just got this error message, when I updated to the new version of WP. I’m sure its about an old theme I got – which hasn’t been updated – but I don’t now how to fix it.

    Error message:

    Parse error: syntax error, unexpected ‘)’ in /var/www/fkmagasin.dk/public_html/wp-content/themes/ModernMag/fw/core/Common.php on line 611

    This is the mentioned code line, I found in FTP:

    return json_decode(json_encode($arr), );

    Does anybody know how to fix this and save my theme. Thank you!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mr Case

    (@mr-case)

    the error says unexpected ‘)’ so maybe change the line:

    return json_decode(json_encode($arr), );

    to this

    return json_decode(json_encode($arr));

    if that does not remove your error, change it back to original and try another thing.
    json decode can accept a ‘true’ argument, so you can also try this:

    return json_decode(json_encode($arr), true);

    • This reply was modified 2 years ago by Mr Case.
    • This reply was modified 2 years ago by Mr Case.

    That theme appears to be a commercial product, you should contact the theme author for support as thats what you paid for.

    madsenand

    (@madsenand)

    Thank you for the answers. I couldn’t get it to work, so I re-installed a backup version of the site and WP

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Parse error with json – WP update’ is closed to new replies.