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

    Kimberlin W
    Participant

    Hi there!
    I would like to change the header tagging wrapped around my logo on the home page to an h2. It is bad for SEO to have more than one h1 (I want to make the content heading with my main keyword the only h1) and the logo script is currently:

    <h1 class="visually-hidden">MyPM</h1>

    I found instructions to create a _brand.php file with the code below and add it to /wp-content/themes/x-child/framework/views/global/

    I created the file and changed the above script to:
    <h2 class="visually-hidden">MyPM</h2>

    I then uploaded via FTP. Yet, when I look at view source on the home page, it still shows an h1 for the logo.

    Am I missing a step?

    Thanks!

    Here’s the code I used in the _brand.php file, with the h2 update:

    <?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() ) ? '<h2 class="visually-hidden">' . $site_name . '</h2>' : '';*/ ?>
    
    <a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
    </a>
    #676809

    Christian
    Moderator

    Hey Kim,

    The line in PHP is commented out:

    <?php /*echo ( is_front_page() ) ? '<h2 class="visually-hidden">' . $site_name . '</h2>' : '';*/ ?>

    Please remove the /* and */

    Thanks.

    #677686

    Kimberlin W
    Participant

    Hi! So, would that line then look like this:

    <?php echo ( is_front_page() ) ? ‘<h2 class=”visually-hidden”>’ . $site_name . ‘</h2>’ : ”; ?>

    I want to make sure I do this correctly, particularly with my not being a developer.

    I appreciate the help.

    #677737

    Jade
    Moderator

    Hi there,

    Yes, that is correct.

    Let us know how it goes.

    #677958

    Kimberlin W
    Participant

    Howdy.

    Ok. I made the change, but sadly, still showing as an h1 when I do view source. Yet, when I go in via FTP client to look at _brand.php file, it’s h2. Here’s what that file now looks like. Maybe there’s some tiny change I need to make?

    <?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() ) ? '<h2 class="visually-hidden">' . $site_name . '</h2>' : ''; ?>
    
    <a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
    </a>
    #678139

    Friech
    Moderator

    Hi There,

    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 to your site
    – WordPress Admin username / password
    – FTP credentials

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

    And since this is a customization that placed on a child theme, please make sure that the child theme is activated.

    Thanks!

    #678875

    Kimberlin W
    Participant
    This reply has been marked as private.
    #678941

    Paul R
    Moderator

    Hi,

    Upon checking, I can see you are using an older version of the theme.

    Please remove _brand.php file in your child theme, then create file _navbar.php in x-child-integrity-light/framework/views/global and copy the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_NAVBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes navbar output.
    // =============================================================================
    
    $get_name          = get_bloginfo( 'name' );
    $get_description   = get_bloginfo( 'description' );
    $x_logo            = get_theme_mod( 'x_logo' );
    $has_primary_nav   = has_nav_menu( 'primary' );
    $one_page_nav_meta = get_post_meta( get_the_ID(), '_x_page_one_page_navigation', true );
    $one_page_nav      = ( $one_page_nav_meta == '' ) ? 'Deactivated' : $one_page_nav_meta;
    
    ?>
    
    <div class="x-navbar-wrap">
      <div class="<?php x_navbar_class(); ?>">
        <div class="x-navbar-inner x-container-fluid max width">
          <?php if ( is_front_page() ) : echo '<h2 class="visually-hidden">' . $get_name . '</h2>'; endif; ?>
          <a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $get_description; ?>">
            <?php echo ( $x_logo == '' ) ? $get_name : '<img src="' . $x_logo . '" alt="' . $get_description . '">'; ?>
          </a>
          <a href="#" class="x-btn-navbar collapsed" data-toggle="collapse" data-target=".x-nav-collapse">
            <i class="x-icon-bars"></i>
            <span class="visually-hidden"><?php _e( 'Navigation', '__x__' ); ?></span>
          </a>
          <nav class="x-nav-collapse collapse" role="navigation">
    
            <?php
    
            if ( $one_page_nav != 'Deactivated' ) :
              wp_nav_menu( array(
                'menu'       => $one_page_nav,
                'container'  => false,
                'menu_class' => 'x-nav x-nav-scrollspy sf-menu'
              ) );          
            elseif ( $has_primary_nav ) :
              wp_nav_menu( array(
                'theme_location' => 'primary',
                'container'      => false,
                'menu_class'     => 'x-nav sf-menu'
              ) );
            else :
              echo '<ul class="x-nav"><li><a href="' . home_url( '/' ) . 'wp-admin/nav-menus.php">Assign a Menu</a></li></ul>';
            endif;
    
            ?>
    
          </nav> <!-- end .x-nav-collapse.collapse -->
        </div> <!-- end .x-navbar-inner -->
      </div> <!-- end .x-navbar -->
    </div> <!-- end .x-navbar-wrap -->
    

    Though we highly recommend that you update your theme and plugins to latest versions due to this vulnerabilities

    https://blog.sucuri.net/2014/09/slider-revolution-plugin-critical-vulnerability-being-exploited.html
    https://forums.envato.com/t/visual-composer-security-vulnerability-fix/10494

    The latest version numbers as of this time are: (http://theme.co/changelog/)

    Visual Composer v4.7.4
    Revolution Slider v5.0.9
    X Theme v4.1.1
    Cornerstone v1.0.6
    x-shortcodes – replaced by cornerstone, please deactivate and delete this plugin before installing cornerstone

    If you find anything to be out of date, you can review our update guide.

    Please test the update first on a staging site as it is more likely that your site will break as you are using a very old version of the theme.

    And don’t forget to create a full back-up of your site.

    https://wordpress.org/plugins/duplicator/

    Hope that helps