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
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):
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.
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, 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.).