<?php

/**
 * The galleries loop
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
wolf_albums_get_template_part('content', 'gallery-' . wolf_get_theme_option('gallery_type'));
     * Albums Category Filter
     */
    wolf_albums_get_template('filter.php');
    ?>

			<?php 
    wolf_albums_loop_start();
    ?>

				<?php 
    while ($loop->have_posts()) {
        $loop->the_post();
        ?>

					<?php 
        wolf_albums_get_template_part('content', 'gallery');
        ?>

				<?php 
    }
    ?>

			<?php 
    wolf_albums_loop_end();
    ?>
				<?php 
    if (wolf_get_theme_option('gallery_infinite_scroll_trigger') && wolf_get_theme_option('gallery_infinite_scroll')) {
        $max = $loop->max_num_pages;
        if (1 < $max) {
            ?>
					<div class="trigger-container">
     * Albums Category Filter
     */
    wolf_albums_get_template('filter.php');
    ?>
			
			<?php 
    wolf_albums_loop_start();
    ?>
				
				<?php 
    while (have_posts()) {
        the_post();
        ?>
				
					<?php 
        wolf_albums_get_template_part('content', 'album');
        ?>
				
				<?php 
    }
    ?>
			
			<?php 
    wolf_albums_loop_end();
    ?>
			
			<?php 
} else {
    ?>

				<?php 
Пример #4
0
        /**
         * Shortcode
         *
         * @param array $atts
         * @return string
         */
        function shortcode($atts)
        {
            extract(shortcode_atts(array('count' => 3, 'category' => null, 'col' => $this->get_option('col', 3)), $atts));
            ob_start();
            $args = array('post_type' => array('gallery'), 'posts_per_page' => absint($count));
            if ($category) {
                $args['gallery_type'] = $category;
            }
            $loop = new WP_Query($args);
            if ($loop->have_posts()) {
                ?>
				<div class="shortcode-gallery-grid gallery-grid-col-<?php 
                echo intval($col);
                ?>
">
					<?php 
                while ($loop->have_posts()) {
                    $loop->the_post();
                    ?>

						<?php 
                    wolf_albums_get_template_part('content', 'album');
                    ?>

					<?php 
                }
                ?>
				</div><!-- .shortcode-albums-grid -->
			<?php 
            } else {
                // no album
                ?>
				<?php 
                wolf_albums_get_template('loop/no-album-found.php');
                ?>
			<?php 
            }
            wp_reset_postdata();
            $html = ob_get_contents();
            ob_end_clean();
            return $html;
        }