Good evening! First of all I am a total newbie and have made a mistake that feels like the end of the world. I would just like a snippet of your wonderful wisdom to get me out of this mess lol! I get this error message PHP Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in \\PDC2\sites\i\impressionsweddinginvitations.co.uk\public_html\wp-content\themes\purple-pastels\functions.php on line 64 The code } endif; add_action( 'after_setup_theme', 'purplepastels_theme_setup' ); // add custom menu support if( function_exists( 'register_nav_menu' ) && !function_exists( 'purplepastels_register_menus' )) : function purplepastels_register_menus() { register_nav_menu( 'toptabs', __( 'Top Tabs', 'purplepastels' ) ); } add_action( 'init', 'purplepastels_register_menus' ); endif; ****I think it relates to the line in bold****** I can not thank you enough in advance if you could provide me with the correct code! Thank you so much Paula (secretly wishing I had a stash of money to pay someone to build my site)
uhm... that code makes no sense... the function declaration probably doesn't go inside the IF, that should be a "{" not a ":" at the end of that IF statement's line... Really though it's that colon that's messing things up. Should be a curly bracket, that isn't a SWITCH/CASE.
Hello Deathshadow! Thank you for replying......i made the change as suggested but this doesn't seem to have fixed the error The code now looks like this } endif; add_action( 'after_setup_theme', 'purplepastels_theme_setup' ); // add custom menu support if( function_exists( 'register_nav_menu' ) && !function_exists( 'purplepastels_register_menus' )) { function purplepastels_register_menus() { register_nav_menu( 'toptabs', __( 'Top Tabs', 'purplepastels' ) ); } add_action( 'init', 'purplepastels_register_menus' ); endif; Anymore suggestions? Once again I thank you for your time in helping me! Kind regards Paula
Uhm... why are you using endIf when you have curly brackets -- that's a OR, not a both... I think how you're even trying to form the IF statements is gibberish unless you do that weirdo <?php ?> nonsense on every blasted line or something else we're just not seeing here. Really your code doesn't make a whole lot of sense -- if the rest of it is anything like this, I'd be surprised to see it reach the line you're saying it's bombing on -- but again, that's why trying to diagnose problems from incomplete snippets are a nightmare. But again, I don't use endif in my code -- ever. That's curly brackets job. Some code indentation wouldn't hurt either. // add custom menu support if ( function_exists('register_nav_menu') && !function_exists('purplepastels_register_menus') ) { function purplepastels_register_menus() { register_nav_menu('toptabs',__('Top Tabs','purplepastels')); } add_action( 'init', 'purplepastels_register_menus' ); } Code (markup): 'endif' construction is just oddball -- it's why you almost never see it used on anything. Though I'm not sure what that __ thing is in your register_nav_menu function call... some sort of needlessly/pointlessly cryptic alias or something? Without seeing the whole thing it's raising more questions than I can provide answers.
People should read and buy books on PHP before asking for questions, otherwise the forum becomes inundated with questions at every step of the way. Please put code in BB [ code][/code] tags.