Created
October 7, 2014 15:05
-
-
Save travismillerweb/15c3520a390978262ae2 to your computer and use it in GitHub Desktop.
PHP - Wordpress Shortcode Functions for Custom Sass Grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP - Wordpress Shortcode Functions for Custom Sass Grid | |
// A Working Shortcode Template for Custom Grid Layouts using Sass | |
/* ============================================================================= | |
Row Block Shortcode | |
========================================================================== */ | |
function row_shortcode($content = null ) { | |
$return_content = do_shortcode($content); | |
return "<div class='row'>". $return_content ."</div>"; | |
} | |
add_shortcode( 'row', 'row_shortcode' ); | |
/* ============================================================================= | |
Column Block Shortcode | |
========================================================================== */ | |
function column_shortcode( $atts, $content = null ) { | |
extract( shortcode_atts( array( | |
'column' => '', | |
), $atts ) ); | |
if ($column) { | |
$layout_type = $column; | |
} | |
$return_content = do_shortcode($content); | |
return "<div class='column-".$layout_type ."'>". $return_content ."</div>"; | |
} | |
add_shortcode( 'column', 'column_shortcode' ); | |
/* ============================================================================ */ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment