Multiple H1 in X theme

Hi, How to remove multiple H1 from X theme. when i look at the source page there were 3 H1’s in code.

  1. “< h1 class=“visually-hidden”>”
  2. /**"-<header class=“x-header-landmark”
  3. Main H1 (page title)
    web URL - https://www.fintown.com/blog

Thanks in advance

Hi There @anishtadimarri

Thanks for writing in!

  1. To remove visually hidden element, first you have to install and activate the child theme(https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

After, create this directory: x-child/framework/legacy/cranium/headers/views/global/ in your child theme and create a file _brand.php file with the following code:

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

With regard to your other concerns, having multiple h1 was detrimental to SEO in the past. But, that is not the case now. X was built using HTML5 and having 2 h1 tags is structurally valid because they’re part of different areas. Also, in modern SEO in combination with HTML5, having multiple h1 will not have an impact on your ranking. X was built with SEO in mind so it’s structurally optimized. You should focus on quality content instead.

Let us know if you have any further questions.
Thanks!

Thanks for your supprot. instead of installing and activating child theme is there any possible way to resolve this issue?

Hi There,

Regretfully, that is the only way to do this. Please follow the instruction provided above.

Thanks,

Hi There,

What happen if i add _brand in Main Theme instead of child theme
Thanks in advance

Hi Anish,

I will try to explain how child themes work. Basically you will have all the original theme files in a separate folder which we call it as parent theme. In this example, _brand.php file is already there on the original theme (parent theme).

To extend it’s functionality, we’re setting up a child theme and copy the template file into the child theme. We’re doing that because, if we directly edit the original theme files as you have suggested, it will be overwrite every-time when you update X theme.

To keep the customizations separately, you need to setup a child theme. If you want more information, I would suggest you to read the following article (http://www.wpbeginner.com/beginners-guide/wordpress-child-theme-pros-cons/).

Hope that’s clear.
Thanks!

Hi There,
Thanks for your support, by following above process i have successfully removed one h1 tag under class=“visually-hidden” but, i can see one more h1 tag under <h1 class="h-landmark"><span></span></h1> is still exist. Kindly guide me to it.
Thanks in advance

Hi @anishtadimarri,

I don’t see any landmark code in your page, but it should be available in file framework\legacy\cranium\headers\views\renew_landmark-header.php

You can copy it to your child theme of the same folder path and modify it based on your preference.

Thanks!

Hi Team,
Multiple h1 issue resolved and thanks for your support.

HI @anishtadimarri,

Happy to hear that.

Feel free to ask us again.

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.