'jetpack-portfolio', 'posts_per_page' => -1, 'tax_query' => [ [ 'taxonomy' => 'jetpack-portfolio-type', 'terms' => $ids, ], ], ]; // Fetch posts. $posts = get_posts( $args ); if ( ! empty( $posts ) ) { $i = 1; foreach ( $posts as $key => $post ) { $portfolio_id = $post->ID; if ( has_post_thumbnail( $portfolio_id ) ) { $img_list_array = wp_get_attachment_image_src( get_post_thumbnail_id( $portfolio_id ), 'business-center-portfolio' ); $img_pop_up_array = wp_get_attachment_image_src( get_post_thumbnail_id( $portfolio_id ), '' ); } else { $img_list_array = business_center_dummy_image( 1000, 750 ); $img_pop_up_array = business_center_dummy_image( 1000, 750 ); } $terms = get_the_terms( $portfolio_id, 'jetpack-portfolio-type' ); $term_string = null; if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { $term_slug = array(); foreach ( $terms as $term ) { $term_slug[ $term->slug ] = $term->name; } } $content[$i]['img_list_array'] = $img_list_array; $content[$i]['img_pop_up_array'] = $img_pop_up_array; $content[$i]['url'] = get_permalink( $portfolio_id ); $content[$i]['portfolio_title'] = get_the_title( $portfolio_id ); $content[$i][ 'filter'] = $term_slug; $i++; } } if ( ! empty( $content ) ) { $input = $content; } break; default: break; } return $input; } endif; add_filter( 'business_center_filter_portfolio_section_details', 'business_center_get_portfolio_section_details' ); if ( ! function_exists( 'business_center_render_portfolio_section' ) ) : /** * Start section class .slider-section * * @return string Slider content * @since Business Center 0.1 * */ function business_center_render_portfolio_section( $content_details = array() ) { $options = business_center_get_theme_options(); $filters = array(); foreach ( $content_details as $content ): if ( ! empty( $content['filter'] ) ) { $filters = array_merge( $content['filter'], $filters ); } endforeach; if ( empty( $content_details ) ) { return; } ?>