Skip to content

Instantly share code, notes, and snippets.

@earthjibber
Created March 11, 2016 19:36
Show Gist options
  • Save earthjibber/5c12a98b77b98488bf78 to your computer and use it in GitHub Desktop.
Save earthjibber/5c12a98b77b98488bf78 to your computer and use it in GitHub Desktop.
// spacer shortcode
// [spacer height="50"]
function spacer_func( $atts ) {
extract (shortcode_atts( array(
'height' => '',
), $atts ));
$height = ($height) ? ' '.$height : '';
return '<div class="spacer cf" style="height:'. $height .'px"></div>';
}
add_shortcode( 'spacer', 'spacer_func' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment