Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1269847
    nourmoubayed
    Participant

    Dear Support,

    My website is showing me multiple H1 tags on every page i have.

    One of the H1 tags is the headline of the page which is okay. But the other H1 tag seems to be a “visually hidden” text on top of the page.
    A third H1 tag seems to be “the Blog” which doesn’t appear on my blog pages because i have it hidden by CSS.

    This is not only for the main page but for all my blog post pages.

    Please let me know how to remove them since this is hurting my seo rankings so bad.

    Looking forward to hear from you. Thanks.

    #1269848
    nourmoubayed
    Participant
    This reply has been marked as private.
    #1269891
    Joao
    Moderator

    Hi There,

    Please refer to this thread:

    https://community.theme.co/forums/topic/remove-h1-from-logo-have-searched-the-forums/

    Hope tht helps

    Joao

    #1269930
    nourmoubayed
    Participant

    Worked amazingly 🙂
    Thanks Joao

    #1269944
    nourmoubayed
    Participant

    Hi again,

    Unfortunately I just realised that my logo disappeared from the Nav bar of my site after adding the _brand.php

    Please let me know how to fix this.

    Thanks.

    #1270060
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! Could you please insert in your next reply the contents of the _brand.php file? The correct one should be 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>

    Please let us know how it goes.

    #1270964
    nourmoubayed
    Participant

    Hi Rue,

    Thanks for the code. This works great.

    The only issue im having is that this code removed H1 tags from all the menu of my website.
    This is good for blog posts because they already have H1 tags on the title of the blog post. But its not good for my Pages (like home page, contact page, terms and condition or any other page on my site) because it leaves the pages without any H1 tag whatsoever.
    So, my question is: Is there a way to edit the code so that it will ONLY remove the H1 tags from the Menu of the Blog posts but leave the H1 Tag on the menu of Pages ?

    Thanks.

    #1271104
    Friech
    Moderator

    Hi There,

    We can add a condition to the above code to show the h1 if its a page.

    Please update the 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 . '">';
    
    ?>
    
    <!-- Condition if its a page or not -->
    <?php if(is_page()): ?>
    <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
    <?php endif; ?>
    
    <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 it helps, Cheers!

    #1274507
    nourmoubayed
    Participant

    Works Great ! Thanks 🙂

    #1274515
    Paul R
    Moderator

    You’re welcome! 🙂

    #1351276
    nourmoubayed
    Participant

    Hi again Paul,

    Sorry for opening this again after a while.

    The code you gave me last worked great: All pages that are blog posts do not have H1 in the logo anymore. And all the Pages of the site that are not blog posts have the site logo as H1.

    All except the Blog Page.

    https://smokingcessationformula.com/blog/

    And https://smokingcessationformula.com/blog/page/2/
    and https://smokingcessationformula.com/blog/page/3/

    Etc.

    Is there a way we can edit the code above so that the Blog pages will also show the Logo as H1 Tag ?

    Thanks

    #1351481
    Friech
    Moderator

    Hi There,

    On the given code above, update the conditional part.

    <!-- Condition if its a page or not -->
    <?php if(is_page()): ?>
    <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
    <?php endif; ?>

    To this:

    <!-- Condition if its a page or blog page -->
    <?php if(is_page() OR is_front_page() OR is_home()) : ?>
    <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
    <?php endif; ?>

    Hope it helps, Cheers!

    #1352613
    nourmoubayed
    Participant

    Works Great !
    Thanks Friech

    #1352946
    Friech
    Moderator

    You’re more than welcome, glad we could help.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1269847 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>