Skip to content

Instantly share code, notes, and snippets.

@slambert
Created July 18, 2010 21:44
Show Gist options
  • Save slambert/480736 to your computer and use it in GitHub Desktop.
Save slambert/480736 to your computer and use it in GitHub Desktop.
/* Render a block of text into two columns. Code from http://css3generator.com/ KBKB */
/* Enclose the block of text in opening and closing shortcodes; */
/* It's best to put the shortcodes on their own line so paragraphs break properly */
/* [maketwocolumns]your multi-paragraph text here[/maketwocolumns] */
/* Works best on long passages and isn't smart enough to avoid orphans/widows */
.maketwocolumns {
-moz-column-count: 2;
-moz-column-gap: 20px;
-webkit-column-count: 2;
-webkit-column-gap: 20px;
column-count: 2;
column-gap: 20px;
}
//add to functions.php
// Make two columns: Render a block of text into two columns
function wpf_maketwocolumns($atts, $content = null) {
return '<div class="maketwocolumns">' . $content . '</div>';
}
add_shortcode("maketwocolumns", "wpf_maketwocolumns");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment