Ejemplo n.º 1
0
    function pod_featured_header_slideshow()
    {
        /* Theme Option Values */
        $options = get_option('podcaster-theme');
        $pod_nav_trans = pod_theme_option('pod-nav-bg');
        $pod_fh_type = pod_theme_option('pod-featured-header-type');
        $pod_fh_content = pod_theme_option('pod-featured-header-content');
        $pod_fh_heading = pod_theme_option('pod-featured-heading');
        $pod_frontpage_bg_color = pod_theme_option('pod-fh-bg');
        if ($pod_fh_content == 'featured') {
            $is_featured = array(array('key' => 'cmb_thst_feature_post', 'value' => 'on'));
        } else {
            $is_featured = '';
        }
        $pod_fh_slides_amount = isset($options['pod-featured-header-slides-amount']) ? $options['pod-featured-header-slides-amount'] : '';
        $arch_category = isset($options['pod-recordings-category']) ? $options['pod-recordings-category'] : '';
        $pod_next_week = isset($options['pod-frontpage-nextweek']) ? $options['pod-frontpage-nextweek'] : '';
        $pod_sub_buttons = pod_theme_option('pod-subscribe-buttons');
        $pod_excerpt_type = isset($options['pod-excerpts-type']) ? $options['pod-excerpts-type'] : '';
        if ($pod_next_week == 'hide') {
            $pod_nextweek_state = 'nw-hidden';
        } else {
            $pod_nextweek_state = '';
        }
        $pod_frontpage_header_par = isset($options['pod-frontpage-header-par']) ? $options['pod-frontpage-header-par'] : '';
        if ($pod_frontpage_header_par == TRUE) {
            $parallax = 'data-stellar-background-ratio="0.5"';
        } else {
            $parallax = '';
        }
        $plugin_inuse = get_pod_plugin_active();
        if ($plugin_inuse == 'ssp') {
            $args = array('posts_per_page' => $pod_fh_slides_amount, 'cat' => '', 'post_type' => 'podcast', 'meta_query' => $is_featured);
        } else {
            $args = array('posts_per_page' => $pod_fh_slides_amount, 'cat' => $arch_category, 'post_type' => 'post', 'meta_query' => $is_featured);
        }
        $the_query = new WP_Query($args);
        $output = '';
        if ($the_query->have_posts()) {
            $output .= '<div class="flexslider-container">';
            $output .= '<div id="loading_bg" class="hide_bg"></div>';
            $output .= '<div class="front-page-header slideshow loading_featured flexslider ' . pod_is_nav_transparent() . ' ' . pod_is_nav_sticky() . ' ' . $pod_nextweek_state . '">';
            $output .= '<div class="slides">';
            while ($the_query->have_posts()) {
                $the_query->the_post();
                global $post;
                /* Post Values */
                $post_format = get_post_format($post->ID);
                $post_title = get_the_title($post->ID);
                $is_featured = get_post_meta($post->ID, 'cmb_thst_feature_post', true);
                $featured_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
                $header_img = get_post_meta($post->ID, 'cmb_thst_feature_post_img', true);
                $bg_style = get_post_meta($post->ID, 'cmb_thst_page_header_bgstyle', true);
                $post_permalink = get_permalink($post->ID);
                $has_excerpt = get_post_meta($post->ID, 'cmb_thst_feature_post_excerpt', true);
                $excerpt_count = get_post_meta($post->ID, 'cmb_thst_featured_post_excerpt_count', true);
                $post_align = get_post_meta($post->ID, 'cmb_thst_feature_post_align', true);
                $post_object = get_post($post->ID);
                if ($has_excerpt == 'on') {
                    if ($post_object->post_excerpt) {
                        $post_excerpt = $post_object->post_excerpt;
                    } elseif (isset($excerpt_count)) {
                        $post_excerpt = pod_flexible_excerpt($post->ID, $excerpt_count);
                    } else {
                        $post_excerpt = '';
                    }
                } else {
                    $post_excerpt = '';
                }
                if ($header_img != '') {
                    $header_img_url = $header_img;
                } else {
                    $header_img_url = $featured_img[0];
                }
                if (!empty($header_img_url)) {
                    $header_state = 'has-header';
                } else {
                    $header_state = '';
                }
                $output .= '<div class="background-image slide ' . $header_state . '" style="background-color:' . $pod_frontpage_bg_color . '; background-image: url(' . $header_img_url . '); ' . $bg_style . '">
						<div class="inside">
							<div class="container">
								<div class="row">
									<div class="col-lg-12">
										<div class="text ' . $post_format . '" style="' . $post_align . '">';
                $output .= pod_featured_multimedia($post->ID);
                $output .= '</div><!-- .text -->';
                $output .= '</div>
								</div>
							</div>
						</div><!-- .inside -->
					</div>';
            }
            $output .= '</div><!-- .slides -->';
            $output .= '</div>';
            if (function_exists('pod_next_week') && ($pod_next_week == 'show' || $pod_sub_buttons)) {
                $output .= pod_next_week();
            }
            $output .= '</div>';
        } else {
            $output .= '<div class="empty-slideshow container">';
            $output .= '<div class="row">';
            $output .= '<div class="col-lg-12">';
            $output .= '<div class="placeholder inside">';
            $output .= '<p>' . __('Please mark your post(s) as featured for them to appear here.', 'thstlang') . '</p>';
            $output .= '</div>';
            if (function_exists('pod_next_week') && ($pod_next_week == 'show' || $pod_sub_buttons)) {
                $output .= pod_next_week();
            }
            $output .= '</div>';
            $output .= '</div>';
            $output .= '</div>';
        }
        wp_reset_postdata();
        return $output;
    }
Ejemplo n.º 2
0
        $attachment_id = get_post_thumbnail_id($post->ID);
        $image_attributes = wp_get_attachment_image_src($attachment_id, 'original');
        // returns an array
        $thumb_back = $image_attributes[0];
        //Header Settings
        $subtitle_blurb = get_post_meta($post->ID, 'cmb_thst_page_subtitle', true);
        $bg_style = get_post_meta($post->ID, 'cmb_thst_page_header_bg_style', true);
        $bg_parallax = get_post_meta($post->ID, 'cmb_thst_page_header_parallax', true);
        $heading_align = get_post_meta($post->ID, 'cmb_thst_page_header_align', true);
        $options = get_option('podcaster-theme');
        ?>
	
	

	<div class="reg <?php 
        echo pod_is_nav_sticky();
        ?>
 <?php 
        echo pod_is_nav_transparent();
        ?>
 <?php 
        echo pod_has_featured_image();
        ?>
">
		<div class="static">
			<?php 
        if (has_post_thumbnail()) {
            ?>
				<?php 
            if ($bg_parallax == 'on') {
                ?>
Ejemplo n.º 3
0
						
				<?php 
} else {
    ?>
				<div class="menu">
					<a href="<?php 
    echo $url = admin_url('nav-menus.php', 'admin');
    ?>
">Please click here to create and set your menu</a>
				</div>
				<?php 
}
?>
				</nav><!--navigation-->
			</div><!--col-lg-9-->
		</div><!--row-->
	</div><!--container-->
</div><!-- .above -->
<div class="nav-placeholder <?php 
echo pod_is_nav_sticky("large_nav");
?>
 <?php 
echo pod_has_featured_image();
?>
 <?php 
echo pod_is_nav_transparent();
?>
 <?php 
echo pod_audio_format_featured_image();
?>
"><p>This is a placeholder for your sticky navigation bar. It should not be visible.</p></div><!-- .above.placeholder -->