/**
     * Show a splash screen on some pages
     */
    public static function wpv_splash_screen()
    {
        if (wpv_post_meta(null, 'show-splash-screen', true) !== 'true') {
            return;
        }
        echo '<div class="wpv-splash-screen">
			<div class="wpv-splash-screen-logo"></div>
		</div>';
    }
    public static function wpv_splash_screen()
    {
        $content = WpvTemplates::has_header_slider() ? '' : do_shortcode(wpv_post_meta(null, 'page-middle-header-content', true));
        $min_height = wpv_post_meta(null, 'page-middle-header-min-height', true);
        if (wpv_post_meta(null, 'show-splash-screen', true) !== 'true') {
            return;
        }
        echo '<div class="wpv-splash-screen">
			<div class="wpv-splash-screen-logo"></div>
		</div>';
    }
Example #3
0
function wpv_post_meta_default($meta, $global, $post_id = null)
{
    if (is_null($post_id)) {
        $post_id = wpv_get_the_ID();
    }
    $global = wpv_sanitize_bool(wpv_get_option($global));
    $local = wpv_sanitize_bool(wpv_post_meta($post_id, $meta, true));
    $local_raw = wpv_post_meta($post_id, $meta);
    if ($local === 'default' || empty($local_raw)) {
        return $global;
    }
    return $local;
}
<header class="header-middle row <?php 
echo $fullwidth ? 'fullwidth' : 'normal';
?>
 <?php 
echo $type;
?>
" style="<?php 
echo $style;
?>
">
	<?php 
/*
 * some pages may not have a slider enabled, check for that
 */
if (WpvTemplates::has_header_slider()) {
    $slider = wpv_post_meta($post_id, 'slider-category', true);
    $slider_engine = preg_match('/^layerslider/', $slider) ? 'layerslider' : 'revslider';
    ?>
		<div id="header-slider-container" class="<?php 
    echo $slider_engine;
    ?>
">
			<div class="header-slider-wrapper">
				<?php 
    get_template_part('slider', $slider_engine);
    ?>
			</div>
		</div>
		<?php 
} elseif ($post_id) {
    ?>
Example #5
0
function theme_body_classes($body_class)
{
    global $wpv_has_header_sidebars, $post, $wpv_is_shortcode_preview;
    $is_blank_page = is_page_template('page-blank.php');
    $has_header_slider = WpvTemplates::has_header_slider();
    $wpv_has_header_sidebars = wpv_post_meta_default('show_header_sidebars', 'has-header-sidebars');
    $has_page_header = (WpvTemplates::has_page_header() || WpvTemplates::has_post_siblings_buttons()) && !is_404();
    $body_class[] = $is_blank_page ? 'full' : wpv_get_option('site-layout-type');
    $body_class[] = 'pagination-' . wpv_get_option('pagination-type');
    $body_class[] = is_singular(WpvFramework::$complex_layout) ? 'sticky-header-type-' . wpv_post_meta(null, 'sticky-header-type', true) : '';
    $body_class[] = 'wpv-not-scrolled';
    $body_class_conditions = array('no-page-header' => !$has_page_header, 'has-page-header' => $has_page_header, 'cbox-share-twitter' => wpv_get_optionb('share-lightbox-twitter'), 'cbox-share-facebook' => wpv_get_optionb('share-lightbox-facebook'), 'cbox-share-googleplus' => wpv_get_optionb('share-lightbox-googleplus'), 'cbox-share-pinterest' => wpv_get_optionb('share-lightbox-pinterest'), 'fixed-header' => wpv_get_optionb('fixed-header'), 'has-header-slider' => $has_header_slider, 'has-header-sidebars' => $wpv_has_header_sidebars, 'no-header-slider' => !$has_header_slider, 'no-header-sidebars' => !$wpv_has_header_sidebars, 'no-footer-sidebars' => !wpv_get_optionb('has-footer-sidebars'), 'responsive-layout' => WPV_RESPONSIVE, 'fixed-layout' => !WPV_RESPONSIVE, 'has-breadcrumbs' => wpv_get_optionb('enable-breadcrumbs'), 'no-breadcrumbs' => !wpv_get_optionb('enable-breadcrumbs'), 'no-slider-button-thumbnails' => !wpv_get_optionb('header-slider-button-thumbnails'), 'sticky-header' => wpv_get_optionb('sticky-header'), 'no-page-bottom-padding' => wpv_post_meta(null, 'use-page-bottom-padding', true) == 'false', 'vamtam-shortcode-tooltip-preview' => $wpv_is_shortcode_preview && strpos($GLOBALS['wpv_current_shortcode'], '[tooltip') !== false);
    foreach ($body_class_conditions as $class => $cond) {
        if ($cond) {
            $body_class[] = $class;
        }
    }
    if (is_archive() || is_search() || get_query_var('format_filter')) {
        define('WPV_ARCHIVE_TEMPLATE', true);
    }
    return $body_class;
}
Example #6
0
 /**
  * Checks whether the current page has a header slider
  * @return boolean true if there is a header slider
  */
 public static function has_header_slider()
 {
     $post_id = wpv_get_the_ID();
     return !is_null($post_id) && apply_filters('wpv_has_header_slider', !is_404() && wpv_post_meta($post_id, 'slider-category', true) !== '' && !is_page_template('page-blank.php'));
 }
 /**
  * Output the correct sidebar
  *
  * @uses dynamic_sidebar()
  *
  * @param  string $place one of $this->placements
  * @return bool          result of dynamic_sidebar()
  */
 public function get_sidebar($place = 'left')
 {
     global $post;
     if (is_front_page() || is_home() || is_page()) {
         $sidebar = $this->sidebars['page'];
     }
     if (is_singular('post')) {
         $sidebar = $this->sidebars['blog'];
     } elseif (is_singular('portfolio')) {
         $sidebar = $this->sidebars['portfolio'];
     }
     if (is_search() || is_archive()) {
         $sidebar = $this->sidebars['blog'];
     }
     if (wpv_has_woocommerce() && is_woocommerce()) {
         $sidebar = $this->sidebars['wpv-woocommerce'];
     }
     if (isset($post)) {
         $custom_sidebar = wpv_post_meta($post->ID, $place . '_sidebar_type', true);
         if (is_active_sidebar($custom_sidebar . '-' . $place)) {
             $sidebar = $custom_sidebar;
         }
     }
     if (isset($sidebar)) {
         return dynamic_sidebar($sidebar . '-' . $place);
     }
     return dynamic_sidebar($this->sidebars['blog'] . '-' . $place);
 }
<?php

/**
 * Header slider template for LayerSlider WP
 *
 * @package  wpv
 */
$post_id = wpv_get_the_ID();
if (is_null($post_id)) {
    return;
}
$slider = str_replace('revslider-', '', wpv_post_meta($post_id, 'slider-category', true));
if (!empty($slider) && function_exists('putRevSlider')) {
    putRevSlider($slider);
}
 /**
  * Return the sermon media meta, to be used with WpvTemplates::show_sermon_media()
  *
  * @return array sermon media meta
  */
 public static function get_sermon_media()
 {
     global $wp_embed;
     $media = array('video', 'audio', 'document', 'link');
     $media_links = array();
     $media_inline = array();
     foreach ($media as $slug) {
         $link = wpv_post_meta(get_the_ID(), "wpv-sermon-{$slug}", true);
         if (!empty($link)) {
             if (($slug == 'video' || $slug == 'audio') && !preg_match('/youtu\\.?be|dailymotion|vimeo/', $link)) {
                 $id = 'sermon-' . md5(uniqid(true));
                 $media_links[$slug] = '#' . $id;
                 $media_inline[$id] = do_shortcode($wp_embed->run_shortcode('[embed width="1000" height="562"]' . strtr($link, array(' ' => '%20')) . '[/embed]'));
             } else {
                 $media_links[$slug] = $link;
             }
         }
     }
     return compact('media_links', 'media_inline');
 }
<?php

/**
 * Header slider template for LayerSlider WP
 *
 * @package  wpv
 */
$post_id = wpv_get_the_ID();
if (is_null($post_id)) {
    return;
}
$id = (int) str_replace('layerslider-', '', wpv_post_meta($post_id, 'slider-category', true));
if (!empty($id) && function_exists('layerslider_check_unit')) {
    $slider = lsSliderById($id);
    if (null !== $slider) {
        $slides = is_string($slider['data']) ? json_decode($slider['data'], true) : $slider['data'];
        echo "<div class='layerslider-fixed-wrapper' style='height:" . layerslider_check_unit($slides['properties']['height']) . "'>";
        // xss ok
        echo do_shortcode('[layerslider id="' . $id . '"]');
        // xss ok
        echo '</div>';
        echo '<div style="height:1px;margin-top:-1px"></div>';
    }
}