WordPress.org

Support

Support » Themes and Templates » Change what is displayed in <title>

Change what is displayed in <title>

  • darthmortar
    Member

    @darthmortar

    How do I change the <TITLE></TITLE> tag so it displays the following;

    On main site e.g. Welcome | blogname

    On singel post e.g. post title | blogname

    On single page e.g. page title | blogname

    With <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blogg arkiv <?php } ?> <?php wp_title(); ?> it shows the blogname first and then where the visitor are, if I change the order I get those >> in wrong places…

Viewing 1 replies (of 1 total)
  • krembo99
    Member

    @krembo99

    <?php if ( is_single() ) { ?> Welcome » <?php bloginfo(‘name’); ?> <?php } ?> <?php wp_title(); ?>

    or consider something like this :

    <title>
    <?php
    if (is_home()) {
    echo bloginfo(‘name’); /** Or whatever you want**/
    } elseif (is_404()) {
    echo ‘404 Not Found’; /** Or whatever you want**/
    } elseif (is_category()) {
    echo ‘Category:’; wp_title(”);
    } elseif (is_search()) {
    echo ‘Search Results’; /** Or whatever you want**/
    } elseif ( is_day() || is_month() || is_year() ) {
    echo ‘Archives:’; wp_title(”);
    } else {
    echo wp_title(”);
    }
    ?>
    </title>

    Also, you might consider using the All In One SEO Pack for wordpress

Viewing 1 replies (of 1 total)
  • The topic ‘Change what is displayed in <title>’ is closed to new replies.