Support » Fixing WordPress » change title tag only on main page

  • Resolved navigadget

    (@navigadget)


    I want to change the title of my front page so that it shows:

    blog name — blog description

    This is the code I have right now:
    <title><?php wp_title(' '); ?><?php if(wp_title(' ', false)) { echo ' --'; } ?> <?php bloginfo('name'); ?></title>

    I don’t want to change its behaviour anywhere else though.
    All other pages I’d like to keep:
    post title — blog name
    category name — blog name

    Can anyone help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • moshu

    (@moshu)

    Topic title misleading: you want to change the <title> tag. You could use some conditionals: http://codex.wordpress.org/Conditional_Tags

    [topic title corrected]

    navigadget

    (@navigadget)

    This seems to do what I want. Thx for the help.
    <title>
    <?php if (is_home())
    {
    bloginfo('name');
    echo ' -- ';
    bloginfo('description');
    }
    else
    { ?>
    <?php wp_title(' '); ?>
    <?php if(wp_title(' ', false))
    {
    echo ' --';
    } ?>
    <?php bloginfo('name');
    } ?>
    </title>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘change title tag only on main page’ is closed to new replies.