Support » Fixing WordPress » SOS! I screwed up my header file

  • I was playing with my header file (truing to get the post title to come before the blog title) and I screwed up the file somehow. Now my pages show the error message:

    Parse error: parse error, unexpected ‘}’ in /home/blogdirectory/public_html/wp-content/themes/retrospotive/header.php on line 8

    Here is the code I played with:

    <?php $curauth = get_userdata($author); ?>
    <title><?php } ?><?php bloginfo('name'); ?><?php if( is_404() ) { ?> &raquo; Not found<?php } elseif (is_day() || is_month() || is_year() ) { ?> &raquo; Archives<?php } elseif ( is_category() ) { ?> &raquo; Archives &raquo; Category<?php } elseif ( is_author() ) { ?> &raquo; Archives &raquo; Author <?php echo "&raquo; " . $curauth->user_nickname; ?><?php } elseif ( is_search() ) { ?> &raquo; <?php echo "Search Results for " . wp_specialchars($s) ; ?><?php wp_title(); ?></title>

    I tried downloading the theme again and copy-pasting the code from there, but to no avail.

    Does anyone know what’d wrong with this?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • What’s above this section:
    <?php $curauth = get_userdata($author); ?>
    <title><?php } ?>

    ?

    Move that extraneous php tag for } towards the end. I’ve broken it up into a more readable form:

    <?php $curauth = get_userdata($author); ?>
    <title><?php bloginfo('name'); ?>
    <?php if( is_404() ) { ?>
    &raquo; Not found
    <?php } elseif (is_day() || is_month() || is_year() ) { ?>
    &raquo; Archives
    <?php } elseif ( is_category() ) { ?>
    &raquo; Archives &raquo; Category
    <?php } elseif ( is_author() ) { ?>
    &raquo; Archives &raquo; Author <?php echo "&raquo; " . $curauth->user_nickname; ?>
    <?php } elseif ( is_search() ) { ?>
    &raquo; <?php echo "Search Results for " . wp_specialchars($s) ; ?>
    <?php } ?>
    <?php wp_title(); ?>
    </title>

    Thread Starter jonestown

    (@jonestown)

    Fixed it. That’ll show me to not save a copy before I start modifying code!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SOS! I screwed up my header file’ is closed to new replies.