Removing multiple H1 tags, causes logo to disappear

Hi,

I followed these instructions to remove multiple h1 tags but that ultimately removed the logo from my site.

Website is https://www.gorillastack.com

How do i fix that please?

Thanks

Hey @ollibe,

I just tested that guide and it works. Does removing that custom _brand.php solve the issue? Also ensure you have uploaded an image in Theme Options > Header > Logo - Image and in Settings > General ensure you have a Site Title.

Thanks.

If I remove _brand.php the logo re-appears

We have a logo and title in place (and have always had that in place)

See attached - the logo is white on transparent but you can see it

And here is the site title

There’s something about _brand.php that’s causing the issue. You can find a copy of the file here: https://drive.google.com/file/d/1NWi06doNYDoDpKvaa2P9IzB_tw5ml31X/view?usp=sharing

Hello There,

The correct code for _brand.php file is 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 . '">';

?>

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

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

If you want to remove the <h1>, you can use this 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 . '">';

?>

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

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

Hope this helps.

Following on from this - can you explain why I still have 2 H1 tags in articles like this?

This is causing me SEO issues

Thanks

Hello There,

Thanks for writing in!

The first h1 is coming from the landmark header and the second one is the post title. To get rid of the h1 in the landmark header since you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new 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; ?>

3] Save the file named as _landmark-header.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/

You will have to create the folder path since it does not exist yet in your child theme.
Please let us know how it goes.

That didn’t work - is the code meant to fix issues with h1 or h2? it looks like a lot of references to h2

Thanks

Hey @ollibe,

First, I’d want to clarify that the theme is SEO optimized. It is just a misconception that multiple h1 affects SEO. That is true in the past but it’s irrelevant in HTML5 which is the one used by X.

Second, I’d want to note that what @mldarshana provided in the thread you referred to in your first post is practically the same as what @RueNel gave in his reply.

It is probably your implementation that is incorrect. The recent instruction @RueNel gave was suppose to change the h1 tag to h2 in the landmark header. That is the area shown in blue in the screenshot below:

The instruction provided by @RueNel should work though you could also try this path. I’ve tested this wp-content/themes/x-child/framework/views/renew/. Please transfer the _landmark-header.php to that path. I’ve tested that personally and it works also.

The most probable reason that it will not work is incorrect implementation. With theme customizations in general, it’s recommended that you consult with a third party developer. But, we would like the get this resolved for this case so if it still does not help, please give us WordPress Admin and FTP access in a Secure Note.

Thanks.

Thanks

I followed the instructions but that didn’t work

I’ve left you a secure note.

Ok. Please correct your FTP credentials first. Looks like you’ve given the database credentials instead of your server.

WordPress access also works but you have given us user level access. Please give us Admin level access.

Thanks.

Thanks,

I’ve updated the user access on WP

The FTP one is weird - that’s the access I gave you I believe - have you tried setting access to port 22?

[EDIT]

Thank you for your help - I’ve gone through the instructions again and this time it has worked. I’ll let you know if I run into any further issues but will revoked access until then.

Much appreciated!

Hello There,

I was able to logged in to your ftp and I have fixed the issue. It turns out that you have uploaded the incorrect filename which is why it is not working. The filename should be _landmark-header.php. You have uploaded _landmarkheader.php which is incorrect.

I went ahead and made the necessary changes to resolve this issue. After correcting the filename, I have cleared your plugin cache since you have installed W3 Total Cache. I also noticed that you are using CloudFlare. It is best that your site cache should be purge also.

I have tested it and the landmark header is now using <h2> tag which has resolve the duplicate issue as your original post mentioned. You might notice that there is now a landmark header title “News” in each of your blog posts. This is how the landmark header works. Before it is displaying a blank title because you did not insert anything. You can check out this setting in X > Theme Options > Renew > Blog Options. If in case you do not want to display anything, you can remove the “News” title and leave it blank.

And if ever you want to totally get rid of the landmark area or the empty space above your blog posts, you may use a custom css to do it. Please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)

.x-header-landmark {
    display: none;
}

And the final result of the page will be like this:

Best Regards.

Thanks - I think we were working on it at the same time.

I have put the file in

wp-content/themes/x-child/framework/views/renew/

where it looks like you have put it in

wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/

Should I remove one of them? If so, which one?

Thanks again for the help

Hey There,

I have resolved it a while ago. I went to logged in again to correct but it seems that you already have revoked all the access.

Place the file in this location:
wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/

And please review all my responses. Thanks.

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