Tagged: , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #103478
    Photogold
    Participant

    In the source code for Clean Box the Primary menu is enclosed by H1 tags . I have been advised to remove these H1 tags as they can be used to describe page content which is a lot more useful from an SEO point of view. How would I do that ? My site is http://www.airport-transfers-falkirk.co.uk

    #103492
    Mahesh
    Keymaster

    @photogold: For that, you’ll need to create a child theme. You can find more details on creating child theme HERE. Then in your child theme’s functions.php add the following code:

    function clean_box_primary_menu() {
        $options  = clean_box_get_theme_options();
    	?>
        <div id="fixed-header-top">
            <div class="wrapper">
                <div id="mobile-primary-menu" class="mobile-menu-anchor fixed-primary-menu">
                    <a href="#mobile-primary-nav" id="primary-menu-anchor" class="genericon genericon-menu">
                        <span class="mobile-menu-text screen-reader-text">
                            <?php esc_html_e( 'Menu', 'clean-box' ); ?>
                        </span>
                    </a>
                </div><!-- #mobile-primary-menu -->
    
                <?php
                    $logo_alt = ( '' != $options['logo_alt_text'] ) ? $options['logo_alt_text'] : get_bloginfo( 'name', 'display' );
    
                    if ( isset( $options[ 'logo_icon' ] ) &&  $options[ 'logo_icon' ] != '' &&  !empty( $options[ 'logo_icon' ] ) ){
                         echo '<div id="logo-icon"><a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home">
                            <img src="' . esc_url( $options['logo_icon'] ) . '" alt="' . esc_attr( $logo_alt ). '">
                        </a></div>';
                    }
                ?>
    
               <nav class="nav-primary search-enabled" role="navigation">
                    <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'clean-box' ); ?>"><?php _e( 'Skip to content', 'clean-box' ); ?></a></div>
                    <?php
                        if ( has_nav_menu( 'primary' ) ) {
                            $clean_box_primary_menu_args = array(
                                'theme_location'    => 'primary',
                                'menu_class'        => 'menu clean-box-nav-menu',
                                'container'         => false
                            );
                            wp_nav_menu( $clean_box_primary_menu_args );
                        }
                        else {
                            wp_page_menu( array( 'menu_class'  => 'menu clean-box-nav-menu' ) );
                        }
    
                        ?>
                </nav><!-- .nav-primary -->
    
                <div id="header-toggle">
                    <a href="#header-toggle-sidebar" class="genericon"><span class="header-toggle-text screen-reader-text"><?php _e( 'Show Header Sidebar Content', 'clean-box' ); ?></span></a>
                </div>
    
                <div id="header-toggle-sidebar" class="widget-area displaynone" role="complementary">
                    <?php if ( is_active_sidebar( 'header-toggle' ) ) { ?>
                        <?php dynamic_sidebar( 'header-toggle' ); ?>
                    <?php
                    }
                    else { ?>
                        <section class="widget widget_search" id="header-serach">
                            <?php get_search_form(); ?>
                        </section>
    
                        <?php
    
                        if ( '' != ( $clean_box_social_icons = clean_box_get_social_icons() ) ) { ?>
                            <section class="widget widget_clean_box_social_icons" id="header-social-icons">
                                <div class="widget-wrap">
                                    <?php echo $clean_box_social_icons; ?>
                                </div>
                            </section>
                        <?php
                        }
                    }
                    ?>
                </div><!-- #header-toggle-sidebar -->
            </div><!-- .wrapper -->
        </div><!-- #fixed-header-top -->
        <?php
    }

    Regards,
    Mahesh

    #103504
    Photogold
    Participant

    Does clean Box pro have the same H1 tag on Primary Menu in the code?

    #103506
    Mahesh
    Keymaster

    @photogold: Yes, same code.

    Regards,
    Mahesh

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘H1 header tags on Primary menu’ is closed to new replies.