Forums

Site title - vertical bar issue, Please help! (1 post)

  1. pahlmeyer
    Member
    Posted 10 months ago #

    I am using the elegant grunge theme and below is the code that I am trying to amend. The problem is that my home page site title is displaying like:

    "| site title"

    I want it to display without the veritical bar:

    "site title"

    When I remove the vertical bar from this line of code:

    <?php if ( is_page() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>

    The problem is fixed for the home page, however, it then messes up for my other pages like "about me", etc. It does not mess up the title for blog page though.

    Please let me know if you can help!

    http://www.pahlmeyer.me

    Here is the full range of code in the header.php file:

    <title>
    <?php if ( is_home() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_search() ) { ?><?php echo $s; ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_single() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_page() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_category() ) { ?><?php _e('Archive', 'elegant-grunge') ?> <?php single_cat_title(); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_month() ) { ?><?php _e('Archive', 'elegant-grunge') ?> <?php the_time('F'); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_tag() ) { ?><?php single_tag_title();?> | <?php bloginfo('name'); ?><?php } ?>
    </title>

Reply

You must log in to post.

About this Topic