Simple Page Sections Shortcode
function page_section_shortcode( $atts , $content = null ) {
extract(shortcode_atts(array(), $atts));
$thecontent = trim(wpautop(do_shortcode($content)));
if (substr($thecontent, 0, 4) == '</p>') { $thecontent = substr($thecontent, 4); };
if (substr($thecontent, -3, 3) == '<p>') { $thecontent = substr($thecontent, 0, -3); };
$thecontent = str_replace("<p>\n", "<p>", $thecontent);
$thehtml = "<div class=\"container-fluid page-section";
if (isset($atts['class'])) { $thehtml .= " ".esc_attr($atts['class'])."\""; } else { $thehtml .= "\""; }
if (isset($atts['id'])) { $thehtml .= " id=\"".esc_attr($atts['class'])."\""; };
if (isset($atts['style'])) { $thehtml .= " style=\"".esc_attr($atts['style'])."\""; };
$thehtml .= ">\n";
$thehtml .= "<div class=\"row\">\n<div class=\"col-sm-12 col-md-6 page-section-inner\">\n";
$thehtml .= $thecontent;
$thehtml .= "\n</div>\n</div>\n</div>\n";
return $thehtml;
}
add_shortcode('page-section', 'page_section_shortcode');