Parse error: syntax error, unexpected ';'

Discussion in 'PHP' started by intcon, Nov 17, 2012.

  1. #1
    I made a change to my wordpress functions.php file, and when I refreshed it, I got this..

    Parse error: syntax error, unexpected ';' in /home/elysseq/public_html/wp-content/themes/monicaburnsv2/functions.php on line 378

    line 378 is

    	echo get_avatar( $comment, $avatar_size );
    Code (markup):
    which is what is was before the change. I immediately took out the new piece of code, and put back in the old, however I'm still getting a parse error. Now the entire blog is down. the site is at monicaburns.com. I'd appreciate any help!!!!

    this is the entire bit of code...

    <div class="comment-author vcard">
    					<?php
    						$avatar_size = 68;
    						if ( '0' != $comment->comment_parent )
    							$avatar_size = 39;
    
    						echo get_avatar( $comment, $avatar_size );
    
    						/* translators: 1: comment author, 2: date and time */
    						printf( __( '%1$s on %2$s <span class="says">said:</span>', 'monicaburns' ),
    							sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
    							sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
    								esc_url( get_comment_link( $comment->comment_ID ) ),
    								get_comment_time( 'c' ),
    								/* translators: 1: date, 2: time */
    								sprintf( __( '%1$s at %2$s', 'monicaburns' ), get_comment_date(), get_comment_time() )
    							)
    						);
    					?>
    
    					<?php edit_comment_link( __( 'Edit', 'monicaburns' ), '<span class="edit-link">', '</span>' ); ?>
    				</div><!-- .comment-author .vcard -->
    Code (markup):
     
    intcon, Nov 17, 2012 IP
  2. diziadvice

    diziadvice Member

    Messages:
    460
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #2
    Just paste the old function.php file that you have saved before editing.
     
    diziadvice, Nov 17, 2012 IP
  3. intcon

    intcon Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tried that. i'm still getting the same error.
     
    intcon, Nov 17, 2012 IP
  4. diziadvice

    diziadvice Member

    Messages:
    460
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #4
    Didn't you create any backup copy of your Wordpress website before changing the file?
     
    diziadvice, Nov 17, 2012 IP
  5. intcon

    intcon Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I did....I backed up the entire site, I have the original php files on hand, and I changed one paragraph...and got the error. So i changed the paragraph back, and got the error. So I copied the entire functions.php file into the editor and still have the error. I haven't yet tried uploading the functions.php file...
    I was hoping someone could just tell me what the parse error is, so I don't have to re-upload the entire site and chance losing something.

    Please.
     
    intcon, Nov 17, 2012 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    The error means that the ; before the indicated line is missing. IOW, the parser found line 378 before it found the ; it was looking for. Your code would look like
    if ( '0' != $comment->comment_parent )
    	$avatar_size = 39 [COLOR="#FF0000"]missing ; here[/COLOR]
    echo get_avatar( $comment, $avatar_size );
    Code (markup):
     
    Rukbat, Nov 22, 2012 IP