'page', 'post__in' => $biography_home_service_posts_ids, 'posts_per_page' => 3, 'orderby' => 'post__in' ); } } // the query if( !empty( $biography_home_service_args )){ $biography_home_service_contents_array = array(); /*again empty array*/ $biography_home_service_post_query = new WP_Query( $biography_home_service_args ); if ( $biography_home_service_post_query->have_posts() ) : $i = 0; while ( $biography_home_service_post_query->have_posts() ) : $biography_home_service_post_query->the_post(); $biography_home_service_contents_array[$i]['biography-home-service-title'] = get_the_title(); $biography_home_service_contents_array[$i]['biography-home-service-content'] = biography_words_count( 30 ,get_the_content()); $biography_home_service_contents_array[$i]['biography-home-service-link'] = get_permalink(); if(isset( $biography_icons_arrays[$i] )){ $biography_home_service_contents_array[$i]['biography-home-service-icon'] = $biography_icons_arrays[$i]; } else{ $biography_home_service_contents_array[$i]['biography-home-service-icon'] = 'fa-desktop'; } $i++; endwhile; wp_reset_postdata(); endif; } return $biography_home_service_contents_array; } endif; if ( ! function_exists( 'biography_home_service' ) ) : /** * Featured Slider * * @since Biography 1.0.0 * * @param null * @return null * */ function biography_home_service() { global $biography_customizer_saved_options; if( 1 != $biography_customizer_saved_options['biography-home-service-enable'] ){ return null; } $biography_service_arrays = biography_home_service_array( ); if( is_array( $biography_service_arrays )){ ?>