Hello!
I can see there are 3 h1 tags on the page which is not good from SEO point of view.
How do I get rid of it., I only need 1 h1 tag which is the entry title of the page.
Kindly provide a fix.
Hello!
I can see there are 3 h1 tags on the page which is not good from SEO point of view.
How do I get rid of it., I only need 1 h1 tag which is the entry title of the page.
Kindly provide a fix.
Hi there,
Thanks for posting in.
Would you mind providing a sample URL we could check? It’s could be the logo, page title, or custom headlines.
And if you wish to remove the H1 from the logo, please clone this file \framework\legacy\cranium\headers\views\global\_brand.php
to your child theme, and remove <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
.
Thanks!
yes, kindly check the following URL, it has 3 h1 tags - https://www.mynoveltyshop.com/product/breast-enlargement-pump/
I’m pasting the code of h1 tags below:
1- <h1 class="visually-hidden">My Novelty Shop</h1>
2- <h1 class="h-landmark"><span></span></h1>
3- <h1 class="product_title entry-title">Breast Enlargement Pump</h1>
Hello @mynoveltyshop,
Looks like you have made the changes from H1 tag to H2. Please see screenshot. https://screencast.com/t/8y17AkWYI
Thanks.
The h2 tag is different on the page. The concern is about H1 tags. Kindly check the source you will find 3 H1 tags on the page.
I only wish to have one h1 tag on the page which should be the product entry title i.e. this tag <h1 class="product_title entry-title">Breast Enlargement Pump</h1>
Hi,
As suggested by my colleague, create file _brand.php
in wp-content/themes/x-child/framework/legacy/cranium/headers/views/global
and copy the code below into that file.
<?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>
After that, create another file _landmark-header.php
in wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew
and copy the code below into that file.
<?php
// =============================================================================
// VIEWS/RENEW/_LANDMARK-HEADER.PHP
// -----------------------------------------------------------------------------
// Handles content output of large headers for key pages such as the blog or
// search results.
// =============================================================================
$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
$breadcrumbs = x_get_option( 'x_breadcrumb_display' );
?>
<?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?>
<?php if ( is_page() && $disable_page_title == 'on' ) : ?>
<?php else : ?>
<header class="x-header-landmark">
<div class="x-container max width">
<div class="x-landmark-breadcrumbs-wrap">
<div class="x-landmark">
<?php if ( x_is_shop() || x_is_product() ) : ?>
<h2 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h2>
<?php elseif ( x_is_bbpress() ) : ?>
<h2 class="h-landmark"><span><?php echo get_the_title(); ?></span></h2>
<?php elseif ( x_is_buddypress() ) : ?>
<?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
<h2 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h2>
<?php endif; ?>
<?php elseif ( is_page() ) : ?>
<h2 class="h-landmark entry-title"><span><?php the_title(); ?></span></h2>
<?php elseif ( is_home() || is_single() ) : ?>
<?php if ( x_is_portfolio_item() ) : ?>
<h2 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h2>
<?php else : ?>
<h2 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h2>
<?php endif; ?>
<?php elseif ( is_search() ) : ?>
<h2 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h2>
<?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?>
<?php
$meta = x_get_taxonomy_meta();
$title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );
?>
<h2 class="h-landmark"><span><?php echo $title; ?></span></h2>
<?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>
<?php
$meta = x_get_taxonomy_meta();
$title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );
?>
<h2 class="h-landmark"><span><?php echo $title ?></span></h2>
<?php elseif ( is_404() ) : ?>
<h2 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h2>
<?php elseif ( is_year() ) : ?>
<h2 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h2>
<?php elseif ( is_month() ) : ?>
<h2 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h2>
<?php elseif ( is_day() ) : ?>
<h2 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h2>
<?php elseif ( x_is_portfolio() ) : ?>
<h2 class="h-landmark"><span><?php the_title(); ?></span></h2>
<?php endif; ?>
</div>
<?php if ( $breadcrumbs == '1' ) : ?>
<?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
<div class="x-breadcrumbs-wrap">
<?php x_breadcrumbs(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ( x_is_portfolio() ) : ?>
<div class="x-breadcrumbs-wrap">
<?php x_portfolio_filters(); ?>
</div>
<?php endif; ?>
</div>
</div>
</header>
<?php endif; ?>
<?php endif; ?>
Kindly note that you have to create these folders in your child theme
/legacy/cranium/headers/views/
Hope that helps
Made the above changes as required by creating the required folders and adding the files but still can see 2 h1 tags.
URL: https://www.mynoveltyshop.com/product/breast-enlargement-pump/
<h1 class="h-landmark"><span></span></h1>
*The tag above is empty.
<h1 class="product_title entry-title">Breast Enlargement Pump</h1>
Hello There,
I have inspected the page and I can confirmed that there are two h1 tags. And then I noticed that you are using W3 Total cache. It could be that you are just experiencing caching issues and that the actual issue should have been resolved. Since you have installed a caching plugin W3 Total Cache, could you please clear your plugin cache and test your site again. Caching plugins are best to turn on only when you’ve finished building the site.
Hope this helps. Please let us know how it goes.
Cleared the cache and also tried deactivating the plugin but didn’t work.
Is the code provided correct? Kindly check.
Thanks!
Hi There,
Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:
Thanks.
Hi There,
I have tried to login to your WordPress backend but I’m getting the following error.
ERROR: The username or password you entered is incorrect.
Could you please confirm?
Thanks!
yes sorry, had forgotten to mention the WP credentials. Have updated the details, you can use the details to login.
Thank you!
Hi,
Upon checking, Ican see your files have .txt
in the end.
I went ahead and change it to _landmark-header.php
Thanks
problem solved, Thank you for the help!
Your welcome. Just an added info. Multiple h1 tags was a bad SEO practice in the past. Now, in the HTML5 era, it is a perfectly valid structure. X uses HTML5 and it is not accidental nor a bug that there is an h1 in certain sections because they are HTML5 semantic structures. Please see the links below for more details.
Thanks.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.