Skip to content

Instantly share code, notes, and snippets.

@mwinckler
Created February 18, 2017 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwinckler/f8c61604ae50b08daff498e3aa0fa915 to your computer and use it in GitHub Desktop.
Save mwinckler/f8c61604ae50b08daff498e3aa0fa915 to your computer and use it in GitHub Desktop.
<?php
// functions.php
add_shortcode( 'contentbox', 'mw_shortcode_contentbox' );
function mw_shortcode_contentbox( $attrs, $content = '' ) {
$parsed_attrs = shortcode_atts( array(
'align' => ''
), $attrs );
return "<aside class='content-box " . $parsed_attrs['align'] . "'>" . $content . "</aside>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment