• Resolved lizmcreations

    (@lizmcreations)


    This site was working perfectly fine yesterday and even this morning … I edited the functions.php file to exclude a couple pages from the vertical menu — which is line 2309 in the file and there is no syntax error in that line — but as soon as I made that change I’m getting the following error:

    Parse error: syntax error, unexpected T_STRING, expecting ‘)’ in /home/content/24/3661724/html/margaretmlynch/wp-content/themes/theme1/functions.php on line 15

    I reversed the change I made – but still the error occurs, so clearly it isn’t because of that change – but I can’t seem to figure out why the error is occurring. Here is the code in question:

    $artThemeSettings = array(
    
    	'menu.showSubmenus' => true,
    
    	'menu.homeCaption' => "Home",
    
    	'menu.showHome' => true,
    
    	'menu.topItemBegin' => "<span class="l"></span><span class="r"></span><span class="t">",
    
    	'menu.topItemEnd' => "</span>",
    
    	'menu.source' => "Pages",
    
    	'vmenu.showSubmenus' => false,
    
    	'vmenu.simple' => false,
    
    	'vmenu.source' => "Pages",
    
    );

    As far as I can see nothing is left “open” and there isn’t anything wrong with that part of the code – and since it was working earlier I am completely stumped as to why it would suddenly not work.

    Can anyone see what I’m not seeing here?

    Thank you!!!!

    Liz

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter lizmcreations

    (@lizmcreations)

    Sorry, I just realized the line numbers aren’t there — specifically line 15 is:

    'menu.topItemBegin' => "<span class="l"></span><span class="r"></span><span class="t">",

    but I know that just that line of code won’t be very helpful.

    Thank you!!

    are you sure the string is properly recognized with the double quotes on the outside and inside ?

    try:
    'menu.topItemBegin' => '<span class="l"></span><span class="r"></span><span class="t">',

    Thread Starter lizmcreations

    (@lizmcreations)

    Ok, interesting … but that didn’t work. I tried it on just that line — then took it one step further and changed all the lines that had the same situation – quotes inside quotes.

    Any other thoughts? I can’t seem to find anything – and I know php enough to make some changes and sometimes troubleshoot – but in this case I’m stumped — so any thoughts/suggestions are much appreciated.

    Liz

    once you have a parse error then you will need to replace the theme functions.php file as changing it will not work.
    Just replace it with the copy if you have one.

    I normally make a habit of keeping copy before I make any change in functions.php file.

    Thread Starter lizmcreations

    (@lizmcreations)

    Thank you! That worked perfectly.

    Now to figure out why there was an issue – I am going to compare the working file and the non-working file to see what happened.

    Thank you again, I really appreciate it.

    Liz

    you are welcome in functions.php file you need to be very care full as very liitle error like ‘ gives a parse error.

    Thread Starter lizmcreations

    (@lizmcreations)

    It was very weird …

    for anyone who finds this and has/had a similar error – the fix/issue in my case was the following:

    'menu.topItemBegin' => "<span class=\"l\"></span><span class=\"r\"></span><span class=\"t\">",

    the quotes for the classes needed to be ‘\”‘ not just ‘”‘

    the unusual thing is that I never changed that — but I wonder if the wordpress editor did (I’ll be editing offline from now on) and updating.

    Thanks again.

    Liz

    I am sorry but i have the same problem i have change something in functions.php and when i update changes there was a parse error. Now i can’t do anything and i also dont know where could i now change code in function.php or just past original code into that file. Please help me!!!

    The functions.php file is in your theme folder
    Using ftp browse to wp-content/themes folder in there you will your theme folder open the folder and there is functions.php file you can rename the file say functions_hold.php for now and upload functions.php file from copy of your theme.

    thank you i have already find a solution with filezila!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Parse Error in my functions.php file – I can't figure out how to fix it …’ is closed to new replies.