Important notice!

We have released an important security update for Bold Builder on August 23, 2019 - please make sure that your Bold Builder installation is updated to the latest version - 2.3.2.

You can update Bold Builder by going to Plugins panel of your wp-admin and by checking the version number next to Bold Builder. If you are offered the option to update it, please do it.

If your version number is lower than 2.3.2 and you have no notification to update it, please download the latest version from https://wordpress.org/plugins/bold-page-builder/ and update the plugin manually.

If you need help in the process, please feel free to leave a ticket and we will assist you.

Okay
  Print

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, and edit the H tag according to your needs:

if ( ! function_exists( 'boldthemes_get_heading_html' ) ) {
    function boldthemes_get_heading_html( $superheadline, $headline, $subheadline, $headline_size, $dash, $el_class, $el_style, $header = false ) {         if ( $header ) {
            if ( MedicareTheme::$what == 'index' && MedicareTheme::$boldthemes_page_for_header_id ) {
                $page = get_post( MedicareTheme::$boldthemes_page_for_header_id );
                $headline = $page->post_title;
                $excerpt = $page->post_excerpt;
                if ( $excerpt != '' ) {
                    $subheadline = '<div class="btSubTitle">' . $excerpt . '</div>';
                }
            } else if ( MedicareTheme::$what == 'search' ) {
                $headline = esc_html__( 'Search', 'medicare' );
            } else if ( MedicareTheme::$what == 'woocommerce' && ! is_singular() && wc_get_page_id( 'shop' ) ) {
                $page = get_post( wc_get_page_id( 'shop' ) );
                $superheadline = '';
                $headline = $page->post_title;
                $excerpt = $page->post_excerpt;
                if ( $excerpt != '' ) {
                    $subheadline = '<div class="btSubTitle">' . $excerpt . '</div>';
                }
            } else if ( is_page() ) {
                $page = get_post( get_the_ID() );
                $excerpt = $page->post_excerpt;
                if ( $excerpt != '' ) {
                    $subheadline = '<div class="btSubTitle">' . $excerpt . '</div>';
                }
            }
        } else {
            if ( $superheadline != '' ) {
                $superheadline = '<div class="btSuperTitle">' . $superheadline . '</div>';
            }             if ( $subheadline != '' ) {
                $subheadline = '<div class="btSubTitle">' . $subheadline . '</div>';
            }
        }
        
        $h_tag = 'h1';
        $class = '';         $style_attr = '';
        if ( $el_style != '' ) {
            $style_attr = 'style="' . esc_attr( $el_style ) . '"';
        }         if ( $headline_size != 'no' ) {
            $class .= $headline_size;
        }
        if ( $headline_size == 'extralarge' || $headline_size == 'huge' ) {
            $h_tag = 'h1';
        } else if ( $headline_size == 'large' ) {
            $h_tag = 'h2';
        } else if ( $headline_size == 'medium' ) {
            $h_tag = 'h3';
        } else {
            $h_tag = 'h4';
        }         if ( $dash == 'yes' ) {
            $dash = 'top';
        }
        
        if( $dash != 'no' && $dash != '' ) {
            $class .= ' btDash ' . $dash . 'Dash';
        }         if ( $el_class != '' ) {
            $class .= ' ' . $el_class;
        }
        
        $output = '<header class="header btClear ' . $class . '" ' . $style_attr . '>';
        $output .= $superheadline;
        if ( $headline != '' ) {
            $pattern = "/<(strong|b|u|i)([> ])/";
            $replace = '<$1 class="animate">';
            $headline = preg_replace($pattern, $replace, $headline);
            $output .= '<div class="dash"><' . $h_tag . '><span class="headline">' . $headline . '</span></' . $h_tag . '></div>';     
        }
        $output .= $subheadline;
        $output .= '</header>';             return $output;
        
    }
}