Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function row_shortcode($atts, $content = null) {
- $atts = shortcode_atts( array(
- 'class' => null,
- 'style' => null,
- 'style_1024' = null,
- 'style_768' = null,
- 'style_540' = null
- ), $atts );
- $uniq_id = uniqid();
- $out = '';
- if (
- (isset($atts['style_1024']) && $atts['style_1024'] != '') ||
- (isset($atts['style_768']) && $atts['style_768'] != '') ||
- (isset($atts['style_540']) && $atts['style_540'] != '')
- ) {
- $out .= '<style type="text/css">';
- if (isset($atts['style_1024']) && $atts['style_1024'] != '') {
- $out .= 'media only screen and (max-width:1024px) {' .
- '#vlad_row_' . $uniq_id . ' {' .
- $atts['style_1024'] .
- '}' .
- '}';
- }
- if (isset($atts['style_768']) && $atts['style_768'] != '') {
- $out .= 'media only screen and (max-width:768px) {' .
- $atts['style_768'] .
- '}';
- }
- if (isset($atts['style_540']) && $atts['style_540'] != '') {
- $out .= 'media only screen and (max-width:540px) {' .
- $atts['style_540'] .
- '}';
- }
- $out .= '</style>';
- }
- return "<div id='vlad_row_{$uniq_id}' class='row ".$atts['class']."' style='".$atts['style']."'><div class='row_width'><div class='row_margin clearfix'>".do_shortcode($content)."</div></div></div>";
- }
Advertisement
Add Comment
Please, Sign In to add comment