Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**********************
- 2 *
- 3 * shortcode handler for columnization of project posts
- 4 * ex: [leftcol]content here...[/leftcol]
- 5 */
- 6 function shortcode_columnize_left( $atts, $content = null ) {
- 7 $content = wptexturize( $content );
- 8 $content = wpautop( $content );
- 9 $content = '<div style="width: 45%; margin-right: 5%; float: left; text-align: justify; ">' . $content . '</div>';
- 10 return $content;
- 11 }
- 12
- 13 /* columnize right inserts 'clear' div after content */
- 14 function shortcode_columnize_right( $atts, $content = null ) {
- 15 $content = wptexturize( $content );
- 16 $content = wpautop( $content );
- 17 $content = '<div style="width: 45%; float: left; text-align: justify;">' . $content . '</div><div style="clear: both;"></div>';
- 18 return $content;
- 19 }
- 20 add_shortcode( 'leftcol', 'shortcode_columnize_left' );
- 21 add_shortcode( 'rightcol', 'shortcode_columnize_right' );
Add Comment
Please, Sign In to add comment