Header Code Trouble
-
I’m a newcomer to web development and WordPress, and the below block of code, which is supposed to change the title based on the current page, causes this error message to appear: “Parse error: syntax error, unexpected ‘{‘ in C:\xampp\htdocs\wordpress\wp-content\themes\Suravara\header.php on line 8” (line 8 is the second line, after the opening php tag). Can anyone help me out wiith this surely simple error? Thanks!
<?php if ( is_single() ) { single_post_title(); } elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); } elseif ( is_page() ) { single_post_title(''); } elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); } elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; } else { bloginfo('name'); wp_title('|'); get_page_number(); } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Header Code Trouble’ is closed to new replies.