if (($video_mp4 || $video_youtube_url) && !wolf_is_slider_in_home_header()) {
        $video_webm = esc_url(wolf_get_theme_option('video_header_bg_webm'));
        $video_ogv = esc_url(wolf_get_theme_option('video_header_bg_ogv'));
        $video_img = esc_url(wolf_get_url_from_attachment_id(wolf_get_theme_option('video_header_bg_img'), 'extra-large'));
        $video_opacity = 100;
        $video_header_bg_color_style = wolf_get_theme_option('video_header_bg_color') ? ' style="background-color:' . wolf_get_theme_option('video_header_bg_color') . '"' : '';
        ?>
		<div class="header-inner">
			<div class="parallax-inner">
				<div class="video-container"<?php 
        echo esc_attr($video_header_bg_color_style);
        ?>
>
					<?php 
        if ($video_mp4 && 'selfhosted' == $video_bg_type) {
            echo wolf_video_bg($video_mp4, $video_webm, $video_ogv, $video_img);
        } elseif ($video_youtube_url && 'youtube' == $video_bg_type) {
            // debug(  $video_img );
            echo wolf_youtube_video_bg($video_youtube_url, $video_img);
        }
        ?>
				</div>
			</div><!-- .parallax-inner -->
			<?php 
        if ($hero && !wolf_is_slider_in_home_header() && 'featured-slider' != $header_type && 'none' != $header_type) {
            ?>
				<div id="hero">
					<div id="hero-content" class="<?php 
            echo esc_attr($font_class);
            ?>
">
    /**
     * Display Page Title
     */
    function wolf_output_title()
    {
        $post_id = wolf_get_header_post_id();
        $hide_title_area = 'none' == wolf_get_theme_option('page_header_type');
        if (get_post_meta($post_id, '_page_header_type', true)) {
            $hide_title_area = 'none' == get_post_meta($post_id, '_page_header_type', true);
        }
        if ($post_id && wolf_get_page_title() && !$hide_title_area && !is_front_page() && !is_page_template('page-templates/home.php')) {
            $type = get_post_meta($post_id, '_header_bg_type', true) ? get_post_meta($post_id, '_header_bg_type', true) : 'image';
            $video_mp4 = get_post_meta($post_id, '_header_video_bg_mp4', true);
            $video_webm = get_post_meta($post_id, '_header_video_bg_webm', true);
            $video_ogv = get_post_meta($post_id, '_header_video_bg_ogv', true);
            $video_img = get_post_meta($post_id, '_header_video_bg_img', true);
            $video_opacity = absint(get_post_meta($post_id, '_header_video_bg_opacity', true)) / 100;
            $video_bg_type = get_post_meta($post_id, '_header_video_bg_type', true) ? get_post_meta($post_id, '_header_video_bg_type', true) : 'selfhosted';
            $video_youtube_url = get_post_meta($post_id, '_header_video_bg_youtube_url', true);
            $image_id = get_post_meta($post_id, '_header_bg_img', true);
            $header_effect = get_post_meta($post_id, '_header_bg_effect', true);
            $do_parallax = 'parallax' == $header_effect;
            $full_screen = 'full' == get_post_meta($post_id, '_page_header_type', true);
            if (wolf_get_category_meta('header_bg_img') && 'image' == wolf_get_category_meta('header_bg_type')) {
                $type = 'image';
                $image_id = wolf_get_category_meta('header_bg_img');
                $header_effect = wolf_get_category_meta('header_bg_effect');
                $do_parallax = 'parallax' == $header_effect;
                $full_screen = 'full' == wolf_get_category_meta('page_header_type');
            }
            if ('video' == wolf_get_category_meta('header_bg_type')) {
                $type = 'video';
                $video_mp4 = wolf_get_category_meta('header_video_bg_mp4');
                $video_webm = wolf_get_category_meta('header_video_bg_webm');
                $video_ogv = wolf_get_category_meta('header_video_bg_ogv');
                $video_opacity = absint(wolf_get_category_meta('header_video_bg_opacity')) / 100;
                $video_img = wolf_get_category_meta('header_video_bg_img');
                $video_bg_type = wolf_get_category_meta('header_video_bg_type');
                $video_youtube_url = wolf_get_category_meta('header_video_bg_youtube_url');
            }
            $class = 'page-header-container';
            $_image = esc_url(wolf_get_url_from_attachment_id($image_id, 'extra-large'));
            if ($do_parallax && $image_id) {
                $class .= ' section-parallax';
            }
            if ($full_screen) {
                $class .= ' full-height';
            }
            echo '<section class="' . esc_attr($class) . '">';
            if ('video' == $type && !is_search()) {
                ?>
				<div class="video-container">
					<?php 
                if ($video_mp4 && 'selfhosted' == $video_bg_type) {
                    echo wolf_video_bg($video_mp4, $video_webm, $video_ogv, $video_img);
                } elseif ($video_youtube_url && 'youtube' == $video_bg_type) {
                    // debug(  $video_img );
                    echo wolf_youtube_video_bg($video_youtube_url, $video_img);
                }
                ?>
				</div>
				<?php 
            }
            if ('zoomin' == $header_effect && $image_id && 'image' == $type && !is_search()) {
                echo '<div class="bg"><img src="' . $_image . '"></div>';
            }
            $page_header_type = wolf_get_theme_option('page_header_type');
            if (get_post_meta($post_id, '_page_header_type', true)) {
                $page_header_type = get_post_meta($post_id, '_page_header_type', true);
                $page_header_type = 'full' == $page_header_type ? 'big' : $page_header_type;
            }
            if (wolf_get_category_meta('page_header_type')) {
                $page_header_type = wolf_get_category_meta('page_header_type');
            }
            echo '<div class="page-header text-center">';
            if ('small' == $page_header_type) {
                if (!get_post_meta($post_id, '_header_hide_title', true)) {
                    echo '<div class="wrap intro">';
                    echo '<div class="breadcrumb">';
                    echo wolf_breadcrumb();
                    echo '</div>';
                    echo '<div class="page-title-container">';
                    echo wolf_get_page_title();
                    echo '</div>';
                    echo '</div>';
                }
            } else {
                if (!get_post_meta($post_id, '_header_hide_title', true)) {
                    echo '<div class="page-title-container intro">';
                    echo wolf_get_page_title();
                    if (is_singular('post')) {
                        echo '<div class="entry-meta">';
                        wolf_post_entry_meta();
                        echo '</div>';
                    }
                    echo '</div>';
                }
            }
            echo '</div><!--.page-header --></section>';
        }
    }
 /**
  * Columns shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_row_shortcode($atts, $content = null)
 {
     $output = $el_class = $custom_class = $style = '';
     extract(shortcode_atts(array('el_class' => '', 'font_type' => 'dark', 'background_color' => '', 'background_type' => '', 'background_image' => '', 'background_position' => '', 'background_attachment' => '', 'background_repeat' => '', 'background_size' => '', 'video_bg_type' => '', 'video_bg_youtube_url' => '', 'video_bg_mp4' => '', 'video_bg_webm' => '', 'video_bg_ogv' => '', 'video_opacity' => '100', 'video_bg_img' => '', 'content_type' => 'standard', 'no_padding' => '', 'padding_top' => '', 'padding_bottom' => '', 'parallax' => '', 'full_screen' => '', 'anchor' => '', 'overlay' => '', 'overlay_image' => '', 'overlay_color' => '', 'overlay_opacity' => '100', 'inline_style' => '', 'hide_class' => ''), $atts));
     $style = '';
     $overlay_style = '';
     $video_opacity = 100;
     $overlay_opacity = $overlay_opacity ? absint($overlay_opacity) / 100 : 0.4;
     $custom_class .= 'wolf-row clearfix content-' . $font_type . '-font' . ' wolf-row-' . $content_type . '-width';
     if ($hide_class) {
         $custom_class .= ' ' . $hide_class;
     }
     if ($video_bg_mp4 || $video_bg_youtube_url) {
         $custom_class .= ' wolf-row-video-bg';
     }
     if ($no_padding) {
         $custom_class .= ' wolf-row-no-padding';
     }
     if ($full_screen) {
         $custom_class .= ' section-full-screen';
     }
     wp_enqueue_script('wpb_composer_front_js');
     $el_class = $this->getExtraClass($el_class);
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_row section ' . $custom_class . ' ' . get_row_css_class() . $el_class, $this->settings['base']);
     $_image = '';
     if ($background_image != ' ') {
         $_image = wolf_get_url_from_attachment_id($background_image, 'extra-large');
     }
     if ($parallax && 'image' == $background_type && $_image) {
         $css_class .= ' section-parallax';
     }
     if ($background_color) {
         $style .= "background-color:{$background_color};";
     }
     if ('image' == $background_type) {
         if ($background_image) {
             $style .= "background-image:url({$_image});";
         }
         if ($background_position) {
             $style .= "background-position:{$background_position};";
         }
         if ($background_repeat) {
             $style .= "background-repeat:{$background_repeat};";
         }
         if ($background_size == 'cover') {
             $style .= "-webkit-background-size: 100%; -o-background-size: 100%; -moz-background-size: 100%; background-size: 100%;-webkit-background-size: cover; -o-background-size: cover; background-size: cover;";
         }
         if ($background_size == 'resize') {
             $style .= "-webkit-background-size: 100%; -o-background-size: 100%;-moz-background-size: 100%; background-size: 100%;";
         }
     }
     // endif image background
     if ($overlay && ('image' == $background_type && $_image || 'video' == $background_type && ($video_bg_mp4 || $video_bg_youtube_url))) {
         $_overlay_image = '';
         if ($overlay_image != '') {
             $_overlay_image = wolf_get_url_from_attachment_id($overlay_image, 'extra-large');
         }
         if ($overlay_color) {
             $overlay_style .= "background-color:{$overlay_color};";
         }
         if ($overlay_image) {
             $overlay_style .= "background-image:url({$_overlay_image});";
         }
         $overlay_style .= "opacity:{$overlay_opacity};";
     }
     $_style = $style ? ' style="' . wolf_compact_css($style) . '"' : '';
     $_overlay_style = $overlay_style ? ' style="' . wolf_compact_css($overlay_style) . '"' : '';
     $section_id = $anchor ? ' id="' . $anchor . '"' : '';
     $output .= '<div' . $_style . $section_id . ' class="' . $css_class . '">';
     $inner_style = '';
     if ('' != $padding_top) {
         $padding_top = is_numeric($padding_top) ? $padding_top . 'px' : $padding_top;
         $inner_style .= "padding-top:{$padding_top};";
     }
     if ('' != $padding_bottom) {
         $padding_bottom = is_numeric($padding_bottom) ? $padding_bottom . 'px' : $padding_bottom;
         $inner_style .= "padding-bottom:{$padding_bottom};";
     }
     if ($video_bg_mp4 && 'video' == $background_type && 'selhosted' == $video_bg_type) {
         $video_bg_img = $video_bg_img ? wolf_get_url_from_attachment_id(absint($video_bg_img), 'extra-large') : null;
         $output .= wolf_video_bg($video_bg_mp4, $video_bg_webm, $video_bg_ogv, $video_opacity, $video_bg_img, $parallax);
     }
     //elseif( $video_bg_youtube_url && 'video' == $background_type && 'youtube' == $video_bg_type ) {
     $output .= wolf_youtube_video_bg($video_bg_youtube_url);
     //}
     if ($overlay) {
         $output .= '<div class="row-overlay"' . $_overlay_style . '></div>';
     }
     $output .= "<div class='wolf-row-inner' style='{$inner_style}'>";
     $output .= '<div class="wrap">';
     $output .= wpb_js_remove_wpautop($content);
     $output .= '</div><!--.wrap-->';
     $output .= "\n";
     $output .= '</div><!--.wolf-row-inner-->';
     $output .= "\n";
     // end row inner
     $output .= '</div><!--.wolf-row-->';
     return $output;
 }
示例#4
0
$section_id = $anchor ? ' id="' . $anchor . '"' : '';
$output .= '<div' . $_style . $section_id . ' class="' . $css_class . '">';
$inner_style = '';
if ('' != $padding_top) {
    $padding_top = is_numeric($padding_top) ? $padding_top . 'px' : $padding_top;
    $inner_style .= "padding-top:{$padding_top};";
}
if ('' != $padding_bottom) {
    $padding_bottom = is_numeric($padding_bottom) ? $padding_bottom . 'px' : $padding_bottom;
    $inner_style .= "padding-bottom:{$padding_bottom};";
}
// video background
if ('video' == $background_type) {
    $video_bg_img = $video_bg_img ? wolf_get_url_from_attachment_id(absint($video_bg_img), 'extra-large') : null;
    if ($video_bg_mp4 && 'selfhosted' == $video_bg_type) {
        $output .= wolf_video_bg($video_bg_mp4, $video_bg_webm, $video_bg_ogv, $video_bg_img, $parallax);
    } elseif ($video_bg_youtube_url && 'youtube' == $video_bg_type) {
        $output .= wolf_youtube_video_bg($video_bg_youtube_url, $video_bg_img);
    }
}
if ($overlay) {
    $output .= '<div class="row-overlay"' . $_overlay_style . '></div>';
}
$output .= "<div class='wolf-row-inner' style='{$inner_style}'>";
$output .= '<div class="wrap">';
$output .= wpb_js_remove_wpautop($content);
$output .= '</div><!--.wrap-->';
$output .= "\n";
$output .= '</div><!--.wolf-row-inner-->';
$output .= "\n";
// end row inner