Exemple #1
0
function foundation_featured_slider($manual = false, $manual_html = false)
{
    global $foundation_featured_posts;
    $args = foundation_featured_get_args();
    if (featured_should_show_slider()) {
        if ($manual == false) {
            if (function_exists('wptouch_custom_posts_add_to_search')) {
                $post_types = wptouch_custom_posts_add_to_search(array('post', 'page'));
            } else {
                $post_types = array('post', 'page');
            }
            $slides = new WP_Query(array('ignore_sticky_posts' => 1, 'post__in' => $foundation_featured_posts, 'post_type' => $post_types));
            if ($slides->post_count > 0) {
                echo $args['before'];
                echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
                echo "<div class='swipe-wrap'>\n";
                while ($slides->have_posts()) {
                    $slides->the_post();
                    $image = foundation_featured_has_image();
                    if (apply_filters('wptouch_has_post_thumbnail', $image)) {
                        get_template_part('featured-slider');
                    }
                }
                echo "</div>\n";
                echo "</div>\n";
                echo $args['after'];
            }
        } else {
            // Private for now, we'll improve manual mode for customer use in 3.2
            echo $args['before'];
            echo "<div id='slider' class='" . implode(' ', foundation_featured_get_slider_classes()) . "'>\n";
            echo "<div class='swipe-wrap'>\n";
            echo $manual_html;
            echo "</div>\n";
            echo "</div>\n";
            echo $args['after'];
        }
        wp_reset_query();
    }
}
function foundation_featured_slider()
{
    global $foundation_featured_posts;
    $settings = foundation_get_settings();
    $args = foundation_featured_get_args();
    if (featured_should_show_slider()) {
        if (function_exists('wptouch_custom_posts_add_to_search')) {
            $post_types = wptouch_custom_posts_add_to_search(array('post', 'page'));
        } else {
            $post_types = array('post', 'page');
        }
        $slides = new WP_Query(array('ignore_sticky_posts' => 1, 'post__in' => $foundation_featured_posts, 'post_type' => $post_types, 'posts_per_page' => $settings->featured_max_number_of_posts));
        if ($slides->post_count > 0) {
            foundation_featured_prefix($args);
            while ($slides->have_posts()) {
                $slides->the_post();
                $image = foundation_featured_has_image();
                if (apply_filters('wptouch_has_post_thumbnail', $image)) {
                    get_template_part('featured-slider');
                }
            }
            foundation_featured_postfix($args);
        }
    }
}
    ?>

				<?php 
    wptouch_show_menu('primary_menu');
    ?>
			</div>
		</div><!-- menu -->

	<?php 
}
?>

	<?php 
do_action('wptouch_advertising_top');
?>

	<?php 
if (function_exists('foundation_featured_slider')) {
    ?>
		<?php 
    if (featured_should_show_slider()) {
        // On homepage load the slider
        ?>
			<?php 
        foundation_featured_slider();
        ?>
		<?php 
    }
    ?>
	<?php 
}