WordPress.org

Ready to get started?Download WordPress

Forums

Change what is displayed in <title> (2 posts)

  1. darthmortar
    Member
    Posted 4 years ago #

    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...

  2. krembo99
    Member
    Posted 4 years ago #

    <?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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.