1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse error: syntax error, unexpected '=' in ....functions.php on line 129

Discussion in 'CSS' started by pierofor, Nov 23, 2012.

  1. #1
    Hello

    We were almost ready with our website when we got this error :
    "Parse error: syntax error, unexpected '=' in ......community/functions.php on line 129"

    and now we can not log in or even see our website .



    Please find here below part of the code .

    Custom header image markup displayed on the Appearance > Header admin panel.
    *
    * Referenced via add_custom_image_header() in cc_setup().
    *
    */
    function cc_admin_header_image() { ?>
    <div id="headimg">
    <?php
    if ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) )
    $style = ' style="display:none;"';
    else
    $style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"';
    ?>
    <h1><a id="name"<?php echo $style; arial> onclick="return false;" href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    <div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
    <img src="<?php esc_url ( header_image() ); ?>" alt="" />
    </div>
    <?php }


    What is your suggestion ?
    Thanks Piero
     
    pierofor, Nov 23, 2012 IP
  2. geforce

    geforce Active Member

    Messages:
    173
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #2
    Your problem is on this line:

    
    <h1><a id="name"<?php echo $style; arial> onclick="return false;" href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    Code (markup):
    it needs to be

    
    <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    Code (markup):
     
    geforce, Dec 30, 2012 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    1) this is the CSS area, not the PHP area... and that's a PHP error.

    2) You would probably have a lot less issues if you used more echo and less opening and closing PHP for no good reason.

    3) Not 100% sure what you are trying to do, but MOST of your code looks like you are inlining presentational crap in the markup that has no business in the markup -- like a display state or color... and yeah, that word 'arial' has no business in there and makes no sense... and using scripting to prevent an anchor from being clickable while having no actual submit method for it... makes one have to ask why the **** is that an anchor?!? (Also unlikely it should he a H1 either)... of course if it is a H1 what the blazes do you need a DIV around it for?

    It should probably read something more like this:
    
    function cc_admin_header_image() {
    	$headerTextColor=get_theme_mod('header_textcolor',HEADER_TEXTCOLOR);
    echo '
    	<div id="headimg"',(
    		(empty($headerTextColor) || ($headerTextColor=='blank')) ?
    		' style="display:none;" ' :
    		' style="color:#'.$headerTextColor.'" '
    	),'>
    		<h1>
    			<a
    				id="name"
    				onclick="return false;"
    				href="',home_url( '/' ),'"
    			>
    				',bloginfo('name'),'
    			</a>
    		</h1>
    		<div id="desc">
    			',bloginfo('description'),'
    		</div>
    		<img src="',esc_url(header_image()),'" alt="" />
    	<!-- #headimg --></div>';
    } // cc_admin_header_img
    
    Code (markup):
    But to be frank, that markup is garbage since if that is indeed a h1 (unlikely), that image is unlikely to be content and as such has no business in the HTML either. It's a laundry list of how not to write markup.
     
    deathshadow, Jan 1, 2013 IP
  4. mymake

    mymake Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Did you check your site with scanning malware? Generally this kind of error in function.php occurred due to malware inserted in code. For removing this kind of error, just replace fresh function.php from new wordpress installation resource. Yesterday my 2 sites impacted with same error and I was able to recover after install fresh function.php. If you check wordpress forums with same issue, you would get lots of feedback with same resolution.
     
    mymake, Jan 18, 2013 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    mymake, when there's an obvious glaring syntax error like
    <?php echo $style; arial>  onclick=
    PHP:
    the most obvious cause is the syntax error, not some malware. (Especially when the error message specifically states that the error is an unexpected '=', and there's an '=' that's not expected right in that syntactical train wreck.).
     
    Rukbat, Jan 18, 2013 IP