if ($title_bg['url'] != '') { $title_style .= 'background-image: url(' . $title_bg['url'] . ');'; $title_style .= 'background-position: ' . $title_bg['position'] . ';'; if ($title_bg['repeat'] == 'cover') { $title_style .= "background-repeat: no-repeat; background-size:cover;"; } else { $title_style .= 'background-repeat: ' . $title_bg['repeat'] . ';'; } if ($title_bg['attach'] != 'parallax') { $title_style .= 'background-attachment: ' . $title_bg['attach'] . ';'; } else { $title_attr .= ''; } } $title_classes .= ' ' . get_parallax_class($title_bg['attach']); $title_attr .= get_parallax_attr(array('type' => $title_bg['attach'])) . ' '; /* set text align ==============================*/ if ($title_align != '') { $title_style .= "text-align:{$title_align};"; } /* set dark text ==============================*/ if ($title_dark == '1') { $title_classes .= ' dark'; } /* set padding ==============================*/ if ($title_padding > 0) { $title_style .= "padding-top:" . $title_padding . "px; padding-bottom:" . $title_padding_bottom . "px;"; }
function blox_parse_row_hook($atts, $content = null) { extract(shortcode_atts(array('columns' => '', 'fullwidth' => '', 'color' => '', 'image' => '', 'bg_repeat' => '', 'bg_position' => '', 'bg_attach' => '', 'text_light' => '', 'extra_class' => '', 'video_active' => '', 'video_m4v' => '', 'video_webm' => '', 'poster' => '', 'no_padding' => '', 'padding_top' => '', 'padding_bottom' => '', 'overlay_color' => '', 'overlay_opacity' => '', 'affix' => ''), $atts)); $attrs = ''; if ($image != '' && $fullwidth == 'true') { $attrs .= "background-image: url({$image}); background-position: {$bg_position};"; $attrs .= $bg_repeat == 'cover' ? "background-size: cover;" : "background-repeat: {$bg_repeat};"; $attrs .= $bg_attach == 'parallax' ? "" : "background-attachment: {$bg_attach};"; } if ($fullwidth == 'true') { if ($color != '') { $attrs .= "background-color: {$color};"; } $extra_class .= ' ' . get_parallax_class($bg_attach); $extra_class .= $text_light == '1' ? ' light' : ''; } $data_attr = get_parallax_attr(array('type' => $bg_attach, 'position' => $bg_position)); if ($affix == '1') { $extra_class .= ' affix-element'; $data_attr .= ' role="complementary" '; } $no_padding_col = $no_padding == '1' ? 'no-padding-columns' : ''; $padding_style = ''; $padding_style .= $padding_top != '' ? 'padding-top:' . (int) $padding_top . 'px;' : ''; $padding_style .= $padding_bottom != '' ? 'padding-bottom:' . (int) $padding_bottom . 'px;' : ''; $overlay_html = ''; if ($overlay_color != '' && $overlay_opacity != '') { $overlay_html = '<div class="section-overlay" style="background-color:' . blox_hex2rgba($overlay_color, floatval($overlay_opacity)) . ';"></div>'; } // video background if ($fullwidth == 'true' && $video_active == '1') { wp_enqueue_style('mediaelement-css', get_template_directory_uri() . '/assets/plugins/mediaelement/mediaelementplayer.min.css'); wp_enqueue_script('mediaelement-js', get_template_directory_uri() . '/assets/plugins/mediaelement/mediaelement-and-player.min.js'); $video_bg = ''; if ($overlay_color != '') { $video_bg .= "background-color: " . blox_hex2rgba($overlay_color, floatval($overlay_opacity)) . ";"; } if ($image != '') { $video_bg .= "background-image: url({$image});"; } return '<div class="section-fullwidth section-video-wrapper ' . $extra_class . '" style="background-image:url(' . $poster . ');' . $padding_style . '"> <div class="section-video hidden-xs hidden-sm" style="background-image:url(' . $poster . ');"> <video controls="controls" preload="auto" loop="true" autoplay="true"> <source type="video/mp4" src="' . $video_m4v . '" /> <source type="video/webm" src="' . $video_webm . '" /> <object width="1900" height="1060" type="application/x-shockwave-flash" data="' . get_template_directory_uri() . '/assets/plugins/mediaelement/flashmediaelement.swf"> <param name="movie" value="' . get_template_directory_uri() . '/assets/plugins/mediaelement/flashmediaelement.swf" /> <param name="flashvars" value="controls=true&file=' . $video_m4v . '" /> </object> </video> </div> <div class="section-background" style="' . $video_bg . '"></div> <div class="container"><div class="section-normal"><div class="row blox-row ' . $no_padding_col . '">' . do_shortcode($content) . '</div></div></div> </div>'; } else { if ($fullwidth == 'true') { return '<div class="section-fullwidth ' . $extra_class . '" style="' . $padding_style . $attrs . '" ' . $data_attr . '> ' . $overlay_html . ' <div class="container"><div class="section-normal"><div class="row blox-row ' . $no_padding_col . '">' . do_shortcode($content) . '</div></div></div> </div>'; } } return '<div class="section-normal ' . $extra_class . '" style="' . $padding_style . $attrs . '"><div class="row blox-row ' . $no_padding_col . '">' . do_shortcode($content) . '</div></div>'; }