Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

header-title

// Add Shortcode
function header_title_shortcode( $atts , $content = null ) {

	// Attributes
	$atts = shortcode_atts(
		array(
			'class' => 'header-title',
			'align' => 'center',
		),
		$atts
	);

	// Check for attribute values.
	$atts_align = ( esc_attr( $atts['align'] ) == 'center' ) ? 'center' : $atts['align'];
	
	// Return
	$title_return = "<div class="". $atts['class'] ."" style="text-align: ". $atts_align .";">". $content ."</div>";
	return $title_return;

}
add_shortcode( 'title', 'header_title_shortcode' );