true, 'orderby' => 'post__in', 'post_type' => 'tp-service', 'post__in' => $ids, ); break; case 'category': $cat_id = array(); if ( !empty( $options['service_category'] ) ) { $cat_id = $options['service_category']; } // Bail if no valid pages are selected. if ( empty( $cat_id ) ) { return $input; }else{ $cat_id = (array)$cat_id; } $args = array( 'no_found_rows' => true, 'category__in' => $cat_id, 'post_type' => 'post', 'posts_per_page' => absint( $options['number_of_services'] ), 'orderby' => 'ASC', ); break; default: break; } if ( 'demo' != $service_content_type && 'custom' != $service_content_type ) { // Fetch posts. $posts = get_posts( $args ); if ( ! empty( $posts ) ) { $i = 1; foreach ( $posts as $key => $post ) { $post_id = $post->ID; $content[ $i ]['title'] = get_the_title( $post_id ); $content[ $i ]['sub_title'] = business_center_pro_trim_content( 20, $post ); $content[ $i ]['url'] = get_the_permalink( $post_id ); if ( 'service' == $service_content_type ) { $content[ $i ]['icon'] = get_post_meta( $post_id, 'tp-service-icon', true ); } else { if ( isset( $options['custom_service_icon_'.$i] ) ) { $content[ $i ]['icon'] = $options['custom_service_icon_'.$i]; } } $i++; } } } if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // Service section content details. add_filter( 'business_center_pro_filter_service_section_details', 'business_center_pro_get_service_section_details' ); if ( ! function_exists( 'business_center_pro_render_service_section' ) ) : /** * Start service section * * @return string Service content * @since Business Center Pro 2.0.0 * */ function business_center_pro_render_service_section( $content_details = array() ) { $options = business_center_pro_get_theme_options(); if ( empty( $content_details ) ) { return; } ?>