<?php if ($blog_type == 'masonry') { get_template_part('page-parts/post-content-masonry'); } else { get_template_part('content', get_post_format()); } } if ($blog_type == 'masonry') { ?> </div> </div> <?php } ?> <?php // Previous/next post navigation. kleo_pagination(); } else { // If no content, include the "No posts found" template. get_template_part('content', 'none'); } ?> <?php get_template_part('page-parts/general-after-wrap'); ?> <?php get_footer();
function kleo_portfolio_items($display_type = 'default', $title_style = 'normal', $columns = 4, $item_count = NULL, $pagination = "no", $filter = 'yes', $excerpt = 'yes', $img_width = '', $img_height = '', $category = '', $exclude_categories = array()) { /* OUTPUT VARIABLE ================================================== */ $portfolio_items_output = ""; $count = 0; /* CATEGORY SLUG ================================================== */ if ($category == "All" || $category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); /* PORTFOLIO QUERY ================================================== */ global $post, $wp_query; if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } if ($exclude_categories == '') { $exclude_categories = array(); } $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'paged' => $paged, apply_filters('kleo_portfolio_cat_slug', 'portfolio-category') => $category_slug, 'posts_per_page' => $item_count, 'tax_query' => array(array('taxonomy' => apply_filters('kleo_portfolio_cat_slug', 'portfolio-category'), 'field' => 'id', 'terms' => $exclude_categories, 'operator' => 'NOT IN'))); $portfolio_args = apply_filters('portfolio_args', $portfolio_args); $portfolio_items = new WP_Query($portfolio_args); /* Class config ================================================== */ $classes = ''; $classes .= ' ' . $display_type . '-style'; if ($display_type == 'overlay') { if ($title_style == 'hover') { $classes .= ' anim-title'; } } if ($excerpt == 'no') { $classes .= ' hide-excerpt'; } $classes .= ' per-row-' . $columns; /* IMAGE SIZE * Set global variables to be availabe in the portfolio template part ================================================== */ if ($img_width != "" && $img_height != '') { global $portfolio_img_width, $portfolio_img_height; $portfolio_img_width = $img_width; $portfolio_img_height = $img_height; } /* ITEMS OUTPUT ================================================== */ if ($filter == 'yes') { $portfolio_items_output = kleo_portfolio_filter($category, $exclude_categories); } $portfolio_items_output .= '<ul class="portfolio-items responsive-cols kleo-masonry ' . $classes . '">' . "\n"; while ($portfolio_items->have_posts()) { $portfolio_items->the_post(); ob_start(); get_template_part('page-parts/portfolio-masonry'); $portfolio_items_output .= ob_get_clean(); $count++; } wp_reset_postdata(); $portfolio_items_output .= '</ul>' . "\n"; /* PAGINATION OUTPUT ================================================== */ if ($pagination == "yes") { $portfolio_items_output .= '<div class="pagination-wrap">'; $portfolio_items_output .= kleo_pagination($portfolio_items->max_num_pages, false); $portfolio_items_output .= '</div>'; } /* FUNCTION OUTPUT ================================================== */ return $portfolio_items_output; }