function block($instance) { extract($instance); $paged = get_query_var('page') ? get_query_var('page') : 1; isset($filter) ? '' : ($filter = 'all'); isset($filters) ? '' : ($filters = 0); isset($isotope_filters) ? '' : ($isotope_filters = 1); isset($disable_ajax) ? '' : ($disable_ajax = 0); isset($disable_ajax_isotope) ? '' : ($disable_ajax_isotope = 1); $disable_ajax == 0 ? $ajax = 'content-slider' : ($ajax = ''); $disable_ajax_isotope == 0 ? $ajax_isotope = 'content-slider' : ($ajax_isotope = ''); if (isset($lightbox) && $lightbox == 1) { $lightbox = 'lightbox'; $ajax = ''; $portfolio_query = new WP_Query('post_type=portfolio&posts_per_page=-1'); } else { $lightbox = ''; $portfolio_query = new WP_Query('post_type=portfolio&posts_per_page=' . get_option('portfolio_posts_per_page', '20') . '&paged=' . $paged); } if (!($filter == 'all')) { if (function_exists('icl_object_id')) { $filter = (int) icl_object_id($filter, 'portfolio-category', true); } $portfolio_query = ''; $portfolio_query = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'id', 'terms' => $filter)))); } switch ($type) { case 'grid': if ($filters == 1) { ?> <div class="fix-portfolio ebor-showcase-filters"> <?php do_action('ebor_open_wrapper'); if ($filter == 'all') { do_action('ebor_portfolio_filters'); } else { $term = get_term($filter, 'portfolio-category'); echo '<ul class="filter"><li><a class="active" href="#" data-filter="*">' . __('All', 'marble') . '</a></li>'; echo '<li><a href="#" data-filter=".' . $term->slug . '">' . $term->name . '</a></li>'; $categories = get_categories('taxonomy=portfolio-category&child_of=' . $filter); foreach ($categories as $category) { echo '<li><a href="#" data-filter=".' . $category->slug . '">' . $category->name . '</a></li>'; } echo '</ul>'; } do_action('ebor_close_wrapper'); ?> </div> <?php } ?> <div class="full-portfolio"> <ul class="<?php echo $ajax; ?> items"> <?php if ($portfolio_query->have_posts()) { while ($portfolio_query->have_posts()) { $portfolio_query->the_post(); ?> <?php get_template_part('content/content', 'showcase' . $lightbox); ?> <?php } } else { ?> <p><?php _e('Sorry, no posts matched your criteria.', 'marble'); ?> </p> <?php } ?> </ul> <?php ebor_load_more($portfolio_query->max_num_pages); wp_reset_query(); ?> </div> <?php break; case 'isotope': ?> <div class="fix-portfolio"> <?php if ($isotope_filters == 1) { if ($filter == 'all') { do_action('ebor_portfolio_filters'); } else { $term = get_term($filter, 'portfolio-category'); echo '<ul class="filter"><li><a class="active" href="#" data-filter="*">' . __('All', 'marble') . '</a></li>'; echo '<li><a href="#" data-filter=".' . $term->slug . '">' . $term->name . '</a></li>'; $categories = get_categories('taxonomy=portfolio-category&child_of=' . $filter); foreach ($categories as $category) { echo '<li><a href="#" data-filter=".' . $category->slug . '">' . $category->name . '</a></li>'; } echo '</ul>'; } } ?> <ul class="<?php echo $ajax_isotope; ?> items thumbs"> <?php if ($portfolio_query->have_posts()) { while ($portfolio_query->have_posts()) { $portfolio_query->the_post(); ?> <?php get_template_part('content/content', 'classic' . $lightbox); ?> <?php } } else { ?> <p><?php _e('Sorry, no posts matched your criteria.', 'marble'); ?> </p> <?php } ?> </ul> <?php ebor_load_more($portfolio_query->max_num_pages); wp_reset_query(); ?> </div> <?php break; } }
<?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php get_template_part('content/content', 'showcaselightbox'); ?> <?php } } else { ?> <p><?php _e('Sorry, no posts matched your criteria.', 'marble'); ?> </p> <?php } ?> </ul> <?php ebor_load_more(); ?> </div>