$portfolio_tags = array(); if (!empty($portfolio_term)) { foreach ($portfolio_term as $term) { $portfolio_tags[] = $term->term_id; } $args['tax_query'] = array(array('terms' => $portfolio_tags, 'taxonomy' => 'portfolio_tag', 'field' => 'id')); } $query = new WP_Query($args); if (!empty($query)) { echo '<div class="gdlr-related-portfolio portfolio-item-holder">'; echo '<h4 class="head">' . __('Related Projects', 'gdlr-portfolio') . '</h4>'; if ($theme_option['related-portfolio-style'] == 'classic-portfolio') { global $gdlr_excerpt_length; $gdlr_excerpt_length = $theme_option['related-portfolio-num-excerpt']; add_filter('excerpt_length', 'gdlr_set_excerpt_length'); echo gdlr_get_classic_portfolio($query, $theme_option['related-portfolio-size'], $theme_option['related-portfolio-thumbnail-size'], 'fitRows'); remove_filter('excerpt_length', 'gdlr_set_excerpt_length'); } else { echo gdlr_get_modern_portfolio($query, $theme_option['related-portfolio-size'], $theme_option['related-portfolio-thumbnail-size'], 'fitRows'); } echo '<div class="clear"></div>'; echo '</div>'; } $gdlr_related_section = false; } ?> </div> <?php get_sidebar('left'); ?> <div class="clear"></div>
function gdlr_get_portfolio_ajax() { $settings = $_POST['args']; $args = array('post_type' => 'portfolio', 'suppress_filters' => false); $args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch']; $args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby']; $args['order'] = empty($settings['order']) ? 'desc' : $settings['order']; $args['paged'] = get_query_var('paged') ? get_query_var('paged') : get_query_var('page'); $args['paged'] = empty($args['paged']) ? 1 : $args['paged']; if (!empty($settings['category'])) { $args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'portfolio_category', 'field' => 'slug')); } $query = new WP_Query($args); $no_space = strpos($settings['portfolio-style'], 'no-space') > 0 ? 'gdlr-item-no-space' : ''; $no_space .= ' gdlr-portfolio-column-' . $settings['portfolio-size']; $ret .= '<div class="portfolio-item-holder ' . $no_space . '">'; if ($settings['portfolio-style'] == 'classic-portfolio' || $settings['portfolio-style'] == 'classic-portfolio-no-space') { $ret .= gdlr_get_classic_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']); } else { if ($settings['portfolio-style'] == 'modern-portfolio' || $settings['portfolio-style'] == 'modern-portfolio-no-space') { $ret .= gdlr_get_modern_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']); } } $ret .= '<div class="clear"></div>'; $ret .= '</div>'; // pagination section $ret .= gdlr_get_ajax_pagination($query->max_num_pages, $args['paged']); die($ret); }
?> columns"> <div class="with-sidebar-content <?php echo esc_attr($gdlr_sidebar['center']); ?> gdlr-item-start-content columns"> <?php if (is_tax('portfolio_category') || is_tax('portfolio_tag')) { global $wp_query; gdlr_include_portfolio_scirpt(); echo '<div class="portfolio-item-holder" >'; if ($theme_option['archive-portfolio-style'] == 'classic-portfolio') { global $gdlr_excerpt_length; $gdlr_excerpt_length = $theme_option['archive-portfolio-num-excerpt']; add_filter('excerpt_length', 'gdlr_set_excerpt_length'); echo gdlr_get_classic_portfolio($wp_query, str_replace('1/', '', $theme_option['archive-portfolio-size']), $theme_option['archive-portfolio-thumbnail-size'], 'fitRows'); remove_filter('excerpt_length', 'gdlr_set_excerpt_length'); } else { if ($theme_option['archive-portfolio-style'] == 'modern-portfolio') { echo gdlr_get_modern_portfolio($wp_query, str_replace('1/', '', $theme_option['archive-portfolio-size']), $theme_option['archive-portfolio-thumbnail-size'], 'fitRows'); } } echo '<div class="clear"></div>'; echo '</div>'; $paged = get_query_var('paged') ? get_query_var('paged') : 1; echo gdlr_get_pagination($wp_query->max_num_pages, $paged); } else { if (is_tax('room_category') || is_tax('room_tag')) { global $wp_query; echo '<div class="room-item-holder" >'; if ($theme_option['archive-room-style'] == 'medium') {