More than one H1 tag - Remove H1 added by X Theme to each page

In the past I could remove the standard H1 tag that X theme adds to all pages with the site name. But after the update, my directions for that no longer work and I need to know how to remove those so they are only manually added.

It used to be that I could follow these instructions (in case this helps):

Go to wp-content\themes\x\framework\views\global - _brand.php

Copy _brand.php file to the same directory in your child theme: public_html/advancelawnservice.com/wp-content/themes/x-child/framework/views/global.

Open the copied file and delete the line

<?php echo '

' . $site_name . '

'; ?>

See video if needed: http://screencast-o-matic.com/watch/cbf1q86RlL

Double check in Moz that extra H1s are gone.


Please help me remove your standard “Stroke of Genius” H1 from every page of this site:

It uses X theme classic with a child theme.

Thanks!
Dawn

Please note: I read this thread - https://theme.co/apex/forum/t/double-h1-tag/10152

But I don’t have the same file structure as what’s listed there, so I can’t use those instructions. This site is running Cornerstone 2.1.1 and classic X theme version 5.2.1. (WP core 4.8.2 and all other plugins updated).

Thanks,
Dawn

Hello Dawn,

Thank you for the very detailed post information. Your experiencing this issue because we have relocated some of the header and footer template files. Before you can find the _brand.php file in wp-content\themes\x\framework\views\global. When we released X 5.0 (https://theme.co/changelog/#theme-x-5-0-0), we have moved it to this folder wp-content\themes\x\framework\legacy\cranium\headers\views\global. So if you want to override _brand.php file in your child theme, you must upload the file in this location: wp-content\themes\x-child\framework\legacy\cranium\headers\views\global\_brand.php.

If you need anything else we can help you with, please let us know.

I was excited to finaly resolve this this morning, but the path you suggest for the child theme does not exist as far as I can see. There is no “legacy” folder in my child theme files. I even tried downloading the Child theme again and yet there is not a file path that you mentioned.

See here: http://somup.com/cb6QIAVqhm

Notice I can only go to wp-content\themes\x-child\framework – But no “Legacy” folder …

Please help asap…
Dawn

Hi Dawn,

Please create new directories if they do not exist.

Regards!

That does not sound right. Are you absolutely 1000% sure? Please confirm. I cannot blow up this site…

Thanks!
Dawn

Okay, I did this and copied the _brand.php file over from X to X-child into the folders I created as you indicated and it did not remove the hidden H1 tags. What else can we do? How can this be a strange request since there should only be one H1 per page. We do not want X to add extra H1 tags. Please help me fix. I have a client with an SEO audit in their hand wanting this fixed asap.

Thanks!
Dawn

Hello There,

Thanks for updating in! Did you just copy it? You did not remove the <h1> tag? The modified content of the _brand.php file should be like this:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

And please make sure that you have uploaded this file in the correct path which is in wp-content\themes\x-child\framework\legacy\cranium\headers\views\global\_brand.php. You will have to create the folder paths.

Please let us know how it goes.

That’s what it was. I got so wrapped up on all the complicated details that I forgot that important step. I REALLY think this is something X theme should consider discontinuing - no automatic H1s…

Thanks,
Dawn

2 Likes

Hello Dawn,

We are just glad we were able to help you out. Thanks for letting us know that it has worked for you.
You’re feedback has been noted by the way.

Cheers.

Do all new users of X theme need to do this as well so we don’t get duplicate h1 tags?

Hello There,

Thanks for updating this thread. This does not apply if you have assigned a custom page as your home page and in that page there is no h1 tag.

If your page is using custom headline or headline element which the h1 tag is the headline level, then you will to remove the duplicate h1 tag since by default the home page has a hidden h1 tag bearing your site title for seo purposes.

Hope this explains it briefly.

That is not applicable in my case and do not understand what you wrote above. Please clarify. Please advise regarding h1 and h2 tags and they google does not see them in the theme and how to rectify it. Currently, all h2 tags when investigated point to “The Blog” instead of the actual h2 in the blog post.

Hey There,

Could you please provide the url of your site so that we can take a closer look?

Thank you in advance.

You actually do not need my URL name as this is happening to all sites using your theme and needs to be fixed. The inspect of the code will show you the h2 tags I have placed on my blog but your theme is overriding it. Please fix.

Thanks for this. Adding the above _brand.php file to my child theme along with the file path successfully removed the h1 tag in the header on homepage but not on any internal pages.

Also dealing with SEO company that wants all H1 tags removed in the head. What else can be done besides changing/removing/commenting out the source file?

Update: not working on internal pages because I had the incorrect folder path. Updated to correct path and now the h1 for me have been changed. Instead of completely removing the code like in example above, I simply just changed the h1 to a p. My code looks like below:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP Update to replace <h1> tag with <p> in header 
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<?php echo '<p class="visually-hidden">' . $site_name . '</p>'; ?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

1 Like

@Swazey that is because you need to do one more thing to do the landmark page. See my post on CSS errors which they give the solution.

However, still waiting for support on how to fix h2 and other h tag issues which are being overridden by theme. Support - kindly get back to us.

Thanks @Vandana, appreciate the response! Good luck with your fix on the other heading tags

Hi @Vandana,

If you have any additional questions at this time we kindly ask that you open them up in a separate thread. The longer threads get in the forum, they become more difficult to support as they tend to drift off topic and they also make it troublesome for users trying to search for solutions. Keeping threads relevant to their original inquiry ensures that we can keep better track of what has been resolved and that users can more effectively find answers to similar issues they might be experiencing.

Thank you for your understanding.