• ghuxel

    (@ghuxel)


    I was trying to edit my navigation bar following one of the WordPress books. I selected the Theme Functions (functions.php) and added a new line – add_theme_support( ‘nav-menus’ ); – and I got this error message:

    parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /home/content/05/9388605/html/wp-content/themes/twentytwelve/functions.php on line 453

    So now whenever I try to log in onto my site, I get the error message and cannot get back on the site. Any suggestions? Are these older WordPress books completely out of date with upgrades to WordPress?

    Gary

Viewing 3 replies - 1 through 3 (of 3 total)
  • I get the error message and cannot get back on the site. Any suggestions?

    Connect to the server via cPanel or FTP and delete that part out, or better yet replace the functions.php with the original.

    Are these older WordPress books completely out of date with upgrades to WordPress?

    This issue has nothing to do with outdate codes, it’s just the syntax error due to a mismatched or an extra or missing curly brace.

    Thread Starter ghuxel

    (@ghuxel)

    Thanx,
    I used the line
    add_theme_support( ‘nav-menus’);
    The error did mention curly braces but the book does not mention these. Are they necessary here, if so then is
    {add_theme_support( ‘nav-menus’)}; correct?

    That’s not correct. add_theme_support() is a function, why would you wrap it in the braces ? That’s not how curly braces are for.

    Review Nav menus codex
    http://codex.ww.wp.xz.cn/Navigation_Menus

    See how it’s done in real working theme like TwentyTwelve for example.

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

The topic ‘Functions.php’ is closed to new replies.