'jetpack-portfolio', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'jetpack-portfolio-type', 'field' => 'id', '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-park-portfolio' ); $img_pop_up_array = wp_get_attachment_image_src( get_post_thumbnail_id( $portfolio_id ), '' ); } else { $img_list_array = array( get_template_directory_uri().'/assets/images/no-featured-image-390x293.jpg'); $img_pop_up_array = array( get_template_directory_uri().'/assets/images/no-featured-image-390x293.jpg'); } $terms = get_the_terms( $portfolio_id, 'jetpack-portfolio-type' ); $term_string = null; $term_slug = array(); 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_park_filter_portfolio_section_details', 'business_park_get_portfolio_section_details' ); if ( ! function_exists( 'business_park_render_portfolio_section' ) ) : /** * Start section class .slider-section * * @return string Slider content * @since Business Park 1.0.0 * */ function business_park_render_portfolio_section( $content_details = array() ) { $options = business_park_get_theme_options(); $ids = array(); if ( !empty( $options[ 'portfolio_category' ] ) && $options[ 'portfolio_category' ] > 0 ) { $ids = $options[ 'portfolio_category' ]; } $terms = get_terms( array( 'taxonomy' => 'jetpack-portfolio-type', 'hide_empty' => false, 'include' => $ids, ) ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { foreach ( $terms as $term ) { $taxonomy_terms[ $term->slug ] = $term->name; } }else{ $taxonomy_terms = array(); } if ( empty( $content_details ) ) { return; } ?>