Help with a syntax error
-
I was attempting to edit my functions.php file because I wanted to add a tops header menu.
I pasted this code into my functions.php
function top_header_menu() {
register_nav_menu(‘top-header-menu’,__( ‘Top Header Menu’ ));
}
add_action( ‘init’, ‘top_header_menu’ );
When I updated the file, I got an error message saying
Parse error: syntax error, unexpected ‘}’ in /home/davidbog/public_html/wp-content/themes/twentyfifteen/functions.php on line 338
So I deleted the code that I pasted but I’m not sure if I accidentally deleted some code or what and the code sections that I pasted it in between now look like this.
function twentyfifteen_search_form_modify( $html ) {
return str_replace( ‘class=”search-submit”‘, ‘class=”search-submit screen-reader-text”‘, $html );
}
add_filter( ‘get_search_form’, ‘twentyfifteen_search_form_modify’ );This is where I pasted the code
/**
* Implement the Custom Header feature.
*
* @since Twenty Fifteen 1.0
*/The theme I’m using is twenty fifteen and my website is
Thank you to anyone that helps.
- The topic ‘Help with a syntax error’ is closed to new replies.