Skip to content

Instantly share code, notes, and snippets.

@NeilJS NeilJS/gist:5900183
Created Jul 1, 2013

Embed
What would you like to do?
Create a div shortcode - so you can wrap content in a div in the WordPress editor. Usage: [div id="ID" class="CLASS"]xxxx[/div]
# For Functions.php
// DIV SHORTCODE. Usage: [div id="ID" class="CLASS"]xxxx[/div]
function createDiv($atts, $content = null) {
extract(shortcode_atts(array(
'id' => "",
'class' => "",
), $atts));
return '<div id="'. $id . '" class="'. $class . '" />' . $content . '</div>';
}
add_shortcode('div', 'createDiv');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.