Okay
  Print

How to change H tag in page headline?

Title in page headline is, by default, set to use h2 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, below the default code that comes with the file.

<?php
if ( ! function_exists( 'boldthemes_header_headline' ) ) {
    function boldthemes_header_headline( $arg = array() ) {
        
        
        BoldThemesFramework::$hide_headline = boldthemes_get_option( 'hide_headline' );
        
        if ( ( ! BoldThemesFramework::$hide_headline && ! is_404() ) ) {
            $extra_class = '';
            
            $dash  = '';
            $use_dash = boldthemes_get_option( 'sidebar_use_dash' );
            if ( $use_dash ) $dash  = apply_filters( 'boldthemes_header_headline_dash', 'bottom' );
            $title = is_front_page() ? get_bloginfo( 'description' ) : 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'] : '0.8';
            $parallax_class = 'btParallax';
            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'];
            }
            // yoast plugin checking
            if ( $title != '' && is_singular() ) {
                if ( class_exists( 'WPSEO_Options' ) ) {
                    $title = get_the_title();
                }
            }
            
            if ( $title != '' || $supertitle != '' || $subtitle != '' ) {
                $extra_class .= boldthemes_get_option( 'below_menu' ) ? ' topLargeSpaced' : ' topSemiSpaced';
                $extra_class .= boldthemes_get_option( 'menu_type' ) == 'hCenter' ? ' btTextCenter' : ' btTextLeft';
                $extra_class .= $feat_image ? ' wBackground cover ' . $parallax_class . ' btDarkSkin btBackgroundOverlay btSolidDarkBackground ' : ' ';
                $feat_image_style = '';
                if ( $feat_image != '' ) {
                    $feat_image_style = ' ' . 'style="background-image:url(' . esc_url_raw( $feat_image ) . ')"' . ' ';
                }
                echo '<section class="boldSection bottomSemiSpaced btPageHeadline gutter ' . esc_attr( $extra_class ) . '"' . $feat_image_style . 'data-parallax="' . esc_attr( $parallax ) . '" data-parallax-offset="0"><div class="port">';
                echo boldthemes_get_heading_html( $supertitle, $title, $subtitle, apply_filters( 'boldthemes_header_headline_size', 'extralarge' ), $dash, '', '' );
                echo '</div>';
            }
            
        }
     }
}
?>