• Any help would be appreciated… I was attempting to customize my functions.php file. At first, it was fine. I added in a custom header specification and it was fine. Then I followed a tutorial for adding a utility bar and now I keep getting this error:

    Parse error: syntax error, unexpected ‘Bar’ (T_STRING) – wp-content/themes/foodiepro/functions.php on line 200

    However, when I run the full .php code in several checkers, it comes back fine. So I’m not sure where it’s going wrong.

    I’ve even tried copying and pasting the original code from the functions.php file and it still returns that same Parse error.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Your current theme (foodiepro) seem to be the issue.

    To confirm, try switching to the unedited default Theme (Twenty Fifteen, etc.) for a moment using FTP , or your web-host’s cPanel or whatever file management application your host provides. Navigate to /wp-content/themes/ and switch to the default theme by renaming your current theme’s folder by adding “-old” to the end of the folder name. Alternately, you can remove other themes except the default theme. That will force your site to use it.

    Then I followed a tutorial for adding a utility bar and now I keep getting this error:

    Parse error: syntax error, unexpected ‘Bar’ (T_STRING) – wp-content/themes/foodiepro/functions.php on line 200

    I’m guessing that this the tutorial you used, in which case, if you simply copied and pasted the code directly from the “Register Utility Bar Widget Areas” section into your functions.php file, then this is exactly the parse error I’d expect to see.

    The code in that section of the article isn’t actually formatted for direct “copy and paste”, in that it contains “curly” quotes where PHP requires “straight” quotes instead.

    So, after pasting the code, you’d have to go through and fix all those quotes in order to have the correct “working” syntax.

    Thread Starter justanothermom

    (@justanothermom)

    Ah, got it, thanks!

    I will navigate away from it, thanks!

    @justanothermom in case you missed it as we were posting at virtually the same time, you might want to have a look at my reply above. 🙂

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

The topic ‘Parse error: syntax error, unexpected 'Bar' (T_STRING)’ is closed to new replies.