WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Modifying page titles (4 posts)

  1. sruddy
    Member
    Posted 2 years ago #

    So Yoast says

    Be aware that for WordPress SEO to be able to modify your page titles, the title section of your header.php file should look like this:

    <title><?php wp_title(''); ?></title>

    My title tag is as shown.
    <title><?php

    if ( is_single() ) { single_post_title(); }

    elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }

    elseif ( is_page() ) { single_post_title(''); }

    elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }

    elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }

    else { bloginfo('name'); wp_title('|'); get_page_number(); }

    ?></title>

    So do I change wp_title('|') to wp_title('') or do I replace everything above with wp_title('')

    Thanks

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. sruddy
    Member
    Posted 2 years ago #

    Let me refraze the question.

    Should my title look like this

    <title>wp_title("")</tittle>

    or like it currently is (see below) which includes wp_title('|')

    <title><?php

    if ( is_single() ) { single_post_title(); }

    elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }

    elseif ( is_page() ) { single_post_title(''); }

    elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }

    elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }

    else { bloginfo('name'); wp_title('|'); get_page_number(); }

    ?></title>

  3. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    It should look as stated in the settings, so indeed:

    <title><?php wp_title(''); ?></tittle>

    And yes that's a whole lot of code to remove :)

  4. sruddy
    Member
    Posted 2 years ago #

    Thanks Joost I actually used the admin supplied check box then checked my code and it was as you stated.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic