Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #390523

    Wonderbird
    Participant

    Hi guys!

    We are a pretty big agency that have just started to use X as our main theme for all our customers and will by buying lots of licenses. We just built a great site, but our SEO guy tells us that the Logo has a H1 in it and that the site is generating two H1, which is not okay for us.

    Is there a css we can paste on the sites we produce to avoid this. We don’t want to charge our customers the extra time of making a child theme, or rewriting the code every time a new update is available.

    Please advice on how to remove the logo H1 tag in a convenient way.

    Best regards
    Christian Schneider

    #390559

    Thai
    Moderator

    Hi There,

    Thanks for writing in!

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
    Then navigate to your child theme’s /framework/views/global directory create a file named _brand.php and paste the code below:

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

    Hope it helps!

    #669838

    Antony H
    Participant

    Will this code also remove the hidden H1 tags from each blog page please? From what I understand using hidden H1 tags is a blackhat technique and is generally frowned upon by Search Engines.

    Thank you

    #669849

    Zeshan
    Member

    Hi Anthony,

    This code is just to remove the H1 tag from the logo. Can you provide us with your URL so we can take a look at your blog page?

    Thank you!

    #669854

    Antony H
    Participant
    This reply has been marked as private.
    #669887

    Paul R
    Moderator

    Hi Anthony,

    Can you specify which h1 tag you are referring to?

    Upon checking your site, I didn’t see any hidden h1 in your blog post.

    Please provide us the url of the page where we could see the issue

    Thanks

    #669986

    Antony H
    Participant
    This reply has been marked as private.
    #670004

    Paul R
    Moderator

    Hi Antony,

    Thank you for the additional information.

    Those headings are not hidden by default. They are now hidden because you added this code in the customizer

    
    .x-landmark {
        display: none;
    }  
    

    If you would like it to be removed completely, create file _landmark-header.php in wp-content/themes/x-child/framework/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', '1' );
    
    ?>
    
    <?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">          
    
              <?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; ?>
    

    Hope that helps.

    #670009

    Antony H
    Participant

    Genius. Thank you for your help.

    #670068

    Rupok
    Member

    You are welcome!

    Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.

    Thanks for using X.

    Cheers!

    #683887

    Antony H
    Participant

    Hi there, I’m still having a problem with the H1 being hidden. I created the file as advised above and added it to the directory in the child-theme folder, but it’s still showing for some reason. Please see attached file.

    Please could you help?

    #683975

    Thai
    Moderator

    Hi Antony,

    In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password
    – FTP Account

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.

    #683980

    Antony H
    Participant
    This reply has been marked as private.
    #683981

    Antony H
    Participant
    This reply has been marked as private.
    #684087

    Thai
    Moderator

    Hi Antony,

    Upon checking your FTP files, I can see that you created the incorrect file name:

    It couldn’t be: brand.php. It should be _brand.php.

    I’ve just renamed it for you.

    Regards!