WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Site Title Appearing in Header of Pages (3 posts)

  1. truelux
    Member
    Posted 1 year ago #

    This is the header.php title tag:

    <title><?php
    global $page, $paged;
    wp_title( '|', true, 'right' );
    bloginfo( 'name' );
    if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'doover' ), max( $paged, $page ) );
    ?>
    </title>

    And here's what the theme is using for the page h1 tags:

    <h1><?php echo trim( wp_title( '', false ) ); ?></h1>

    I don't know that much about PHP but I think forcing the titles or editing that would mess up other features of the theme? I don't like how the title of the site is included in the h1, I'd only want the title to appear.

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

  2. truelux
    Member
    Posted 1 year ago #

    The Blog Title Appears Next to H1 Title in Header?

    WordPress version: 3.4.1
    WordPress SEO version: 1.2.5

    My theme uses the following title PHP code in the header.php file:

    <title><?php
    global $page, $paged;
    wp_title( '|', true, 'right' );
    bloginfo( 'name' );
    if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'doover' ), max( $paged, $page ) );
    ?>
    </title>

    Then it also uses the following php title code for the header and h1 tag:

    <h1><?php echo trim( wp_title( '', false ) ); ?></h1>

    So in the h1 I get TITLE - WEBSITE.COM, instead of just TITLE.

    This is extremely annoying since you obviously don't want the website/blog name appearing within the h1 tag, only as part of the pages title.

    I tried editing the header.php and h1 code to:

    <h1><?php the_title(); ?></h1>

    and it worked but then the blog page was messed up.... Not sure what's going on :(

    thanks in advance.

  3. Nick Martin
    Member
    Posted 1 year ago #

    We're having a similar issue. The "SEO title" we set using the plugin overrides the post title we display on the page as the H1.

    If we use a custom field to set the meta title then it works fine and leaves the post title as is

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic