I’m using the WordPress “Edge” theme. With this theme the site name has H1 tags and I would like to remove them. See on https://www.archlogo.com/ the site name under the triangular logo. The problem is that those tags are in the functions.php file and I don’t know how to use it. I don’t know anything about PHP and how to override parent theme functions. Here is a part of the code in the function.php including the H1s :

/******************* Edge Header Display *************************/
function edge_header_display(){
    $edge_settings = edge_get_theme_options();
    $header_display = $edge_settings['edge_header_display'];
    if ($header_display == 'header_text') { ?>
        <div id="site-branding">
        <?php if(is_home() || is_front_page()){ ?>
        <h1 id="site-title"> <?php }else{?> <h2 id="site-title"> <?php } ?>
            <a href="<?php echo esc_url(home_url('/'));?>" title="<?php echo esc_attr(get_bloginfo('name', 'display'));?>" rel="home"> <?php bloginfo('name');?> </a>
        <?php if(is_home() || is_front_page() || is_search()){ ?>
        </h1>  <!-- end .site-title -->
        <?php } else { ?> </h2> <!-- end .site-title --> <?php } 
        $site_description = get_bloginfo( 'description', 'display' );
        if($site_description){?>
        <p id ="site-description"> <?php bloginfo('description');?> </p> <!-- end #site-description -->
        <?php } ?>
        </div> <!-- end #site-branding -->
        <?php
    } elseif ($header_display == 'header_logo') { ?>
        <div id="site-branding"> <?php edge_the_custom_logo(); ?></div> <!-- end #site-branding -->
        <?php } elseif ($header_display == 'show_both'){ ?>
        <div id="site-branding"> <?php edge_the_custom_logo(); ?></a>
        <?php if(is_home() || is_front_page()){ ?>
        <h1 id="site-title"> <?php }else{?> <h2 id="site-title"> <?php } ?>
            <a href="<?php echo esc_url(home_url('/'));?>" title="<?php echo esc_attr(get_bloginfo('name', 'display'));?>" rel="home"> <?php bloginfo('name');?> </a>
            <?php if(is_home() || is_front_page()){ ?> </h1> <!-- end .site-title -->
        <?php }else{ ?> </h2> <!-- end .site-title -->
        <?php }
        $site_description = get_bloginfo( 'description', 'display' );
            if($site_description){?>
            <p id ="site-description"> <?php bloginfo('description');?> </p><!-- end #site-description -->
        <?php } ?>
        </div> <!-- end #site-branding -->
        <?php }
}

Do you know how to remove those H1 tags ?

Read more here: Removing h1 tags inside functions.php (using a child theme)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: