Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Last active August 29, 2015 14:21
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 joshcanhelp/5c31f8aa7194e63582bd to your computer and use it in GitHub Desktop.
Save joshcanhelp/5c31f8aa7194e63582bd to your computer and use it in GitHub Desktop.
Three columns using a shortcode (don't hate)
function otm_sc_column_wrap ( $atts = array(), $content ) {
return '<div class="column-wrap">' . do_shortcode( $content ) . '</div>';
}
add_shortcode( 'column_wrap', 'otm_sc_column_wrap' );
function otm_sc_column_3 ( $atts = array(), $content ) {
return '<div class="column-3">' . do_shortcode( $content ) . '</div>';
}
add_shortcode( 'column_3', 'otm_sc_column_3' );
/*
Add this to your content editor:
[column_wrap]
[3_column]
text in first column
[/3_column]
[3_column]
text in second column
[/3_column]
[3_column]
text in third column
[/3_column]
[/column_wrap]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment