Пример #1
0
<?php

/**
 * Home Header
 */
$header_type = wolf_get_theme_option('home_header_type');
$hero = stripslashes(wolf_get_theme_option('home_header_content'));
$video_mp4 = esc_url(wolf_get_theme_option('video_header_bg_mp4'));
$video_bg_type = wolf_get_theme_option('video_header_bg_type');
$video_youtube_url = esc_url(wolf_get_theme_option('video_header_bg_youtube_url'));
$font_class = 'content-' . wolf_get_theme_option('header_bg_font_color') . '-font';
// Featured Post Slider
if ('featured-slider' == $header_type) {
    if (0 < wolf_get_slide_loop()->post_count) {
        get_template_part('partials/slider', 'home');
    }
} elseif ('standard' == $header_type) {
    if ((wolf_get_theme_option('header_bg_img') || wolf_get_theme_option('header_bg_color')) && !wolf_is_slider_in_home_header()) {
        $img_url = wolf_get_url_from_attachment_id(wolf_get_theme_option('header_bg_img'), 'extra-large');
        echo '<div class="header-inner">';
        if ('parallax' == wolf_get_theme_option('hero_effect')) {
            echo '<div class="parallax-inner">';
        } else {
            echo '<div class="hero-inner">';
        }
        if ('zoom' == wolf_get_theme_option('hero_effect')) {
            echo '<div class="bg"><img src="' . esc_url($img_url) . '"></div>';
        }
        echo '</div>';
        // end parallax or hero inner
        if ($hero && !wolf_is_slider_in_home_header()) {
 /**
  * Check if home header is set
  *
  * @access public
  * @return bool
  */
 function wolf_is_home_header()
 {
     $header_type = wolf_get_theme_option('home_header_type');
     if ('none' != $header_type) {
         if ('standard' == $header_type && wolf_get_theme_option('header_bg_img') || wolf_get_theme_option('header_bg_color')) {
             return true;
         }
         if ('video' == $header_type && wolf_get_theme_option('video_header_bg_mp4') || wolf_get_theme_option('video_header_bg_webm')) {
             return true;
         }
         if ('wolf-slider' == $header_type) {
             return true;
         }
         if ('revslider' == $header_type) {
             return true;
         }
         if (0 < wolf_get_slide_loop()->post_count && 'featured-slider' == $header_type) {
             return true;
         }
     }
 }
Пример #3
0
<?php

/**
 * Home page featured post slider
 */
$loop = wolf_get_slide_loop();
$slider_speed = wolf_get_theme_option('slider_speed') ? absint(wolf_get_theme_option('slider_speed')) : 5000;
$pause_on_hover = wolf_get_theme_option('slider_speed') ? 'true' : 'false';
$slideshow = wolf_get_theme_option('slider_autoplay') ? 'true' : 'false';
/* The loop */
if ($loop->have_posts()) {
    ?>
	<script type="text/javascript">
		jQuery( document ).ready(function(){
			var defaultTransition = ( Modernizr.isTouch ) ? 'slide' : 'fade',
				homeSliderTransition = WolfThemeParams.sliderEffect;
			if ( 'auto' === WolfThemeParams.sliderEffect ) {
				homeSliderTransition = defaultTransition;
			}
			jQuery( '#featured-post-wolf-slider' ).wolfslider( {
				animation: 'fade',
				slideshow : <?php 
    echo esc_attr($slideshow);
    ?>
,
				pauseOnHover: <?php 
    echo esc_attr($pause_on_hover);
    ?>
,
				slideshowSpeed : <?php 
    echo absint($slider_speed);