Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

My shortcode title

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

	// Attributes
	extract( shortcode_atts(
		array(
			'style' => '',
		), $atts )
	);

	// Code
	switch($style){
	    case 'green':
	        return '<div class="main_title has_bg blue_bg upper"><h2><span class="line"></span>' . $content . '</h2></div>';
		break;

		case 'line':
	        return '<div class="main_title upper"><h2><span class="line"><span class="dot"></span></span>' . $content . '</h2></div>';
		break;

		case 'red':
	        return '<h2 class="title1 title_color1 upper">' . $content . '</h2>';
		break;

		default:
	        return $content;
		break;
	}
}
add_shortcode( 'mytitle', 'my_shortcode_title' );