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

    barkinglife
    Participant

    My main page the theme automatically defining my H1 and is placing it has visually hidden. How do I remove this and define my first custom headline has an H1. https://www.barkinglife.com

    See code generated from page source

    <h1 class=”visually-hidden”>Barking Life Pet Concierge</h1>

    #376887

    Rupok
    Member

    Hi there,

    Thanks for writing in! I am not sure where you are getting this. It should only to be added on the Logo Text if you use image as logo. That is if you use image logo, the class will hide the text as you don’t need it behind the logo.

    I can’t see it’s being added anywhere and you can add your custom headline without any issue.

    Thanks

    #376927

    barkinglife
    Participant

    How do I remove <h1 class=”visually-hidden”>Barking Life Pet Concierge</h1> Hiding H1 and other content is bad for SEO. Plus I prefer to define my own H1 content.

    Do I remove this code out of the brand.php or what do I adjust or remove?

    #377103

    Friech
    Moderator

    Hi There,

    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 on the child theme’s framework/views/global/ directory create a file named _brand.php and paste 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 . '">';
    
    ?>
    
    <?php /*echo ( is_front_page() ) ? '<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 it helps, Cheers!

    #377973

    barkinglife
    Participant

    You post still has <?php /*echo ( is_front_page() ) ? ‘<h1 class=”visually-hidden”>’ . $site_name . ‘</h1>’ : ”;*/ ?> Do I just remove that line or do I need to change it?

    #378112

    Rupok
    Member

    Hi there,

    You can remove/change this line if you want.

    Thanks

    #875402

    flacnvinyl
    Participant
    This reply has been marked as private.
    #875929

    Rue Nel
    Moderator

    Hello Drake,

    Thanks for updating this thread!
    Yes, this would still work and the best way to remove the H1 tag in your site.

    If you need anything else we can help you with, please let us know.

    #1045060

    mathijs84
    Participant
    This reply has been marked as private.
    #1045302

    Rupok
    Member

    Hi there,

    Thanks for updating. Make sure the file reside on right directory (VIEWS/GLOBAL/_BRAND.PHP)

    If you think you placed it correctly, then you can share your login credentials in a private reply. Note that it’s not a good idea to share login credentials on other user’s thread because if we reply in private, yo uwon’t be able to see that. So you can open a new thread, reference this thread and share your details in a separate private reply. But make sire to check your directory first as suggested.

    Cheers!