<?php /** * Slider or custom content between the menu and the page title * * @package wpv * @subpackage church-event */ global $wp_embed; $post_id = wpv_get_the_ID(); $content = WpvTemplates::has_header_slider() ? '' : do_shortcode($wp_embed->run_shortcode(wpv_post_meta($post_id, 'page-middle-header-content', true))); $fullwidth = wpv_post_meta($post_id, 'page-middle-header-content-fullwidth', true) === 'true'; $min_height = wpv_post_meta($post_id, 'page-middle-header-min-height', true); if (!WpvTemplates::has_header_slider() && empty($content) && empty($min_height) && !WpvFancyPortfolio::has('disabled')) { return; } if (is_page_template('page-blank.php')) { return; } $style = WpvTemplates::get_title_style(); if (!WpvTemplates::has_header_slider()) { $style .= "min-height:{$min_height}px"; } $type = WpvTemplates::has_header_slider() ? 'type-slider' : 'type-featured'; ?> <header class="header-middle row <?php echo $fullwidth ? 'fullwidth' : 'normal'; ?> <?php echo $type; ?>
<article id="post-<?php the_ID(); ?> " <?php post_class(WpvTemplates::get_layout()); ?> > <?php global $wpv_has_header_sidebars; if ($wpv_has_header_sidebars) { WpvTemplates::header_sidebars(); } ?> <div class="page-content"> <?php if (WpvFancyPortfolio::has('page')) { $fancy_portfolio_resizing = get_post_meta($post->ID, 'fancy-portfolio-resizing', true); $data = WpvFancyPortfolio::get(); ?> <script> jQuery(function($) { var correct_height = <?php echo (int) get_post_meta($post->ID, 'fancy-portfolio-height', true); ?> , win_width = $(window).width(); if(win_width < WPV_FRONT.content_width) correct_height *= win_width / WPV_FRONT.content_width; $.WPV.PortfolioSlider.init(<?php
/** * 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) !== '' && WpvFancyPortfolio::has('disabled') && !is_page_template('page-blank.php')); }
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') && WpvFancyPortfolio::has('disabled'); $has_page_header = (WpvTemplates::has_page_header() || WpvTemplates::has_post_siblings_buttons()) && !is_404(); $full_bg_slider = WpvFancyPortfolio::has('background'); $ajax_portfolio = WpvFancyPortfolio::has('page'); $body_class[] = $full_bg_slider || $is_blank_page ? 'full' : wpv_get_option('site-layout-type'); $body_class[] = 'pagination-' . wpv_get_option('pagination-type'); $body_class[] = is_singular(array('post', 'page', 'portfolio', 'wpv_sermon', 'tribe_events')) ? '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, 'full-bg-slider' => $full_bg_slider, 'fast-slider' => $full_bg_slider, 'has-ajax-portfolio' => $ajax_portfolio, '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') && !$full_bg_slider && !$ajax_portfolio, 'no-page-bottom-padding' => is_singular() && wpv_post_meta(null, 'use-page-bottom-padding', true) == 'false', 'vamtam-shortcode-tooltip-preview' => $wpv_is_shortcode_preview && strpos($GLOBALS['current_wpv_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; }
/** * Initializes the ajax portfolio */ public static function init_ajax() { if (WpvFancyPortfolio::has('page')) { get_template_part('templates/ajax-portfolio-viewer'); } }