'page', 'post__in' => $biography_home_history_posts_ids, 'posts_per_page' => 3, 'orderby' => 'post__in' ); } } // the query if( !empty( $biography_home_history_args )){ $biography_home_history_contents_array = array(); /*again empty array*/ $biography_home_history_post_query = new WP_Query( $biography_home_history_args ); if ( $biography_home_history_post_query->have_posts() ) : $i = 0; while ( $biography_home_history_post_query->have_posts() ) : $biography_home_history_post_query->the_post(); $biography_home_history_contents_array[$i]['biography-home-history-title'] = get_the_title(); $biography_home_history_contents_array[$i]['biography-home-history-content'] = biography_words_count( 30 ,get_the_content()); $biography_home_history_contents_array[$i]['biography-home-history-link'] = get_permalink(); if(isset( $biography_icons_arrays[$i] )){ $biography_home_history_contents_array[$i]['biography-home-history-icon'] = $biography_icons_arrays[$i]; } else{ $biography_home_history_contents_array[$i]['biography-home-history-icon'] = 'fa-desktop'; } if(isset( $biography_duration_arrays[$i] )){ $biography_home_history_contents_array[$i]['biography-home-history-duration'] = $biography_duration_arrays[$i]; } else{ $biography_home_history_contents_array[$i]['biography-home-history-duration'] = ''; } $i++; endwhile; wp_reset_postdata(); endif; } return $biography_home_history_contents_array; } endif; if ( ! function_exists( 'biography_home_history' ) ) : /** * Featured Slider * * @since Biography 1.0.0 * * @param null * @return null * */ function biography_home_history() { global $biography_customizer_saved_options; if( 1 != $biography_customizer_saved_options['biography-home-history-enable'] ){ return null; } $biography_home_history_title = $biography_customizer_saved_options['biography-home-history-title']; $biography_history_arrays = biography_home_history_array(); if( is_array( $biography_history_arrays )){ ?>