How to change H tag in page headline?

Title in page headline is, by default, set to use h1 tag.


In order to change the tag, you will need to customize part of the theme's code, so some familiarity with PHP is necessary.

First, install and activate the child theme. Then, to child theme's functions.php file add the following code:


/**
 * Header headline output
 */
if ( ! function_exists( 'boldthemes_header_headline' ) ) {
    function boldthemes_header_headline( $arg = array() ) {
        $extra_class = 'btPageHeadline';
        
        $dash  = '';
        $use_dash = boldthemes_get_option( 'sidebar_use_dash' );
        if ( is_singular( 'post' ) ) {
            $use_dash = boldthemes_get_option( 'blog_use_dash' );
        } else if ( is_singular( 'product' ) ) {
            $use_dash = boldthemes_get_option( 'shop_use_dash' );
        }  else if ( is_singular( 'portfolio' ) ) {
            $use_dash = boldthemes_get_option( 'pf_use_dash' );
        } 
        if ( $use_dash ) $dash  = apply_filters( 'boldthemes_header_headline_dash', 'top' );
        if ( is_front_page() ) {
            $title = get_bloginfo( 'description' );
        } else if ( is_singular() ) {
            $title = get_the_title();
        } else {
            $title = wp_title( '', false );
        }
        
        if ( BoldThemesFramework::$page_for_header_id != '' ) {
            $feat_image = wp_get_attachment_url( get_post_thumbnail_id( BoldThemesFramework::$page_for_header_id ) );
            
            $excerpt = boldthemes_get_the_excerpt( BoldThemesFramework::$page_for_header_id );
            if ( ! $feat_image ) {
                if ( is_singular() && ! is_singular( 'product' ) ) {
                    $feat_image = wp_get_attachment_url( get_post_thumbnail_id() );
                } else {
                    $feat_image = false;
                }
            }
        } else {
            if ( is_singular() ) {
                $feat_image = wp_get_attachment_url( get_post_thumbnail_id() );
            } else {
                $feat_image = false;
            }
            $excerpt = boldthemes_get_the_excerpt( get_the_ID() );
        }
        
        $parallax = isset( $arg['parallax'] ) ? $arg['parallax'] : apply_filters( 'boldthemes_header_headline_parallax', '0.8' );
        $parallax_class = 'bt_bb_parallax';
        if ( wp_is_mobile() ) {
            $parallax = 0;
            $parallax_class = '';
        }
        
        $supertitle = '';
        $subtitle = $excerpt;
        
        $breadcrumbs = isset( $arg['breadcrumbs'] ) ? $arg['breadcrumbs'] : true;
        
        if ( $breadcrumbs ) {
            $heading_args = boldthemes_breadcrumbs( false, $title, $subtitle );
            $supertitle = $heading_args['supertitle'];
            $title = $heading_args['title'];
            $subtitle = $heading_args['subtitle'];
        }
        
        if ( $title != '' || $supertitle != '' || $subtitle != '' ) {
            $extra_class .= $feat_image ? ' bt_bb_background_image ' . apply_filters( 'boldthemes_header_headline_gradient', 'bt_bb_background_overlay_dark_solid' ) . ' ' . $parallax_class . ' btDarkSkin ' : ' ';
            echo '<section class="bt_bb_section gutter bt_bb_vertical_align_top ' . esc_attr( $extra_class ) . '" style="background-image:url(' . esc_url_raw( $feat_image ) . ')" data-parallax="' . esc_attr( $parallax ) . '" data-parallax-offset="0">';
                echo '<div class="bt_bb_port port">';
                    echo '<div class="bt_bb_cell">';
                        echo '<div class="bt_bb_cell_inner">';
                            echo '<div class="bt_bb_row">';
                                echo '<div class="bt_bb_column">';
                                    echo '<div class="bt_bb_column_content">';
                                        echo boldthemes_get_heading_html( 
                                            array(
                                                'superheadline' => $supertitle,
                                                'headline' => $title,
                                                'subheadline' => $subtitle,
                                                'html_tag' => "h1",
                                                'size' => apply_filters( 'boldthemes_header_headline_size', 'large' ),
                                                'dash' => $dash,
                                                'el_style' => '',
                                                'el_class' => ''
                                            )
                                        );
                                        echo '</div><!-- /rowItemContent -->' ;
                                    echo '</div><!-- /rowItem -->';
                            echo '</div><!-- /boldRow -->';
                        echo '</div><!-- boldCellInner -->';    
                    echo '</div><!-- boldCell -->';            
                echo '</div><!-- port -->';
            echo '</section>';
        }
        
    }
}


Once you add the code, change the H tag defined in this part of the code:

'html_tag' => "h1",