Skip to content

Instantly share code, notes, and snippets.

@michaeljs1990 michaeljs1990/gist:6265916
Last active Dec 21, 2015

Embed
What would you like to do?
Shortcode Example
<?php //always use <?php because <? will be depricated in php 6.0
// [defaultButton text="My Button"]
// This would display the bootstrap button with the text My Button inside it.
function bootstrapDefaultBTN( $atts ) {
extract( shortcode_atts( array(
'text' => 'Button',
), $atts ) );
//Button created using bootstrap class that is already pulled in through our theme.
$bootstrapBTN = "<button type='button' class='btn'>" . $text . "</button>"
return $bootstrapBTN;
}
//Shortcode for default bootstrap 2.3 Button
add_shortcode( 'defaultButton', 'bootstrapDefaultBTN' );
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.