[Resolved] Two title tags

Home Forums Support Two title tags

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #260933
    morriscountynj

    Very strange issue I’m having with my GP sites, and somehow I didn’t notice it until now.

    Every page has two title tags!

    The first is the <title> via the All-in-One SEO plugin. The second is the <title> auto-generated by WordPress.

    If I disable All-in-One SEO, I STILL GET TWO TITLES. It’s seriously bizarre.

    I was wondering if you’ve ever encountered this with GP, and if it might have anything to do with the theme.

    If it helps, I’m using a child theme with a custom header.php, here’s the <head> code:

    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <?php 
    wp_head();
    $generate_settings = wp_parse_args( 
    	get_option( 'generate_settings', array() ), 
    	generate_get_defaults() 
    );
    ?>
    <script>
      $(".main-title").fitText();
    </script>
    
    </head>
    
    #260934
    morriscountynj

    Actually figured it would help more for you to see the whole of header.php:

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <main id="main">
     *
     * @package Generate
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <?php 
    wp_head();
    $generate_settings = wp_parse_args( 
    	get_option( 'generate_settings', array() ), 
    	generate_get_defaults() 
    );
    ?>
    <script>
      $(".main-title").fitText();
    </script>
    
    </head>
    
    <body itemtype="http://schema.org/WebPage" itemscope="itemscope" <?php body_class(); ?>>
    	<?php do_action( 'generate_before_header' ); ?>
    	<header itemtype="http://schema.org/WPHeader" itemscope="itemscope" id="masthead" role="banner" <?php generate_header_class(); ?>>
    		<div <?php generate_inside_header_class(); ?>>
    			<?php do_action( 'generate_before_header_content'); ?>
    			
    
                
             	<?php generate_construct_logo(); ?>
                
                
    			<?php if ( empty( $generate_settings['hide_title'] ) || empty( $generate_settings['hide_tagline'] ) ) : ?>
    				<div class="site-branding">
                       <?php if ( empty( $generate_settings['hide_tagline'] ) ) : ?>
    					<p class="site-description"><?php bloginfo( 'description' ); ?></p>
    				<?php endif; ?>
                        
    				<?php if ( empty( $generate_settings['hide_title'] ) ) : ?>
    					<h1 class="main-title" itemprop="headline"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    				<?php endif; ?>
    				
    		
    				
    				</div>
                
    <?php generate_construct_header_widget(); ?>
                
                
          
    			
    			
    			<?php endif; ?>
    			<?php do_action( 'generate_after_header_content'); ?>
    		</div><!-- .inside-header -->
    	</header><!-- #masthead -->
    	<?php do_action( 'generate_after_header' ); ?>
    	
    	<div id="page" class="hfeed site grid-container container grid-parent">
    		<div id="content" class="site-content">
    
    <noscript>
    <ul class="pagenav">
    <?php wp_nav_menu( array(
        'menu' => 'main',
    'depth' => 1
    ) ); ?>
    </ul>
    <style>
    #site-navigation {display:none;}
    .pagenav {margin:0 auto;text-align:center;}
    .pagenav:after {content: ".";
        display: block;
        height: 0;
        clear: both;
        visibility: hidden;}
    .menu-item {margin:0 2em 2em 0; list-style:none;float:left;}
     .my-account{background:none;}
      
    </style>
    </noscript>
    
    			<?php do_action('generate_inside_container'); ?>
    
    
    #260967
    Tom
    Lead Developer
    Lead Developer

    You need to remove this line as WordPress adds the title tag for you:

    <title><?php wp_title( '|', true, 'right' ); ?></title>

    #260984
    morriscountynj

    got it, thanks!

    #260987
    Tom
    Lead Developer
    Lead Developer
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.