Created
March 11, 2015 01:39
-
-
Save 3200creative/e5bc3446bcfd4efa5419 to your computer and use it in GitHub Desktop.
Section With Wrap Shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Page Section with field for unique class. | |
function contentSection( $atts, $content = null ) { | |
$content = preg_replace('#^<\/p>|<p>$#', '', $content); | |
$a = shortcode_atts( array( | |
'class' => 'Add Classes Here', | |
), $atts ); | |
return '<div class="full-block '."{$a['class']}".' "><div class="wrap">' . do_shortcode($content) . '</div></div>'; | |
} | |
add_shortcode('content-section', 'contentSection'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment