'post', 'cat' => $thebusiness_home_about_category, 'posts_per_page' => $thebusiness_home_about_number ); } }else { $thebusiness_home_about_posts = salient_customizer_get_repeated_all_value(3 , $thebusiness_home_about_page); $thebusiness_home_about_posts_ids = array(); if( null != $thebusiness_home_about_posts ) { foreach( $thebusiness_home_about_posts as $thebusiness_home_about_post ) { if( 0 != $thebusiness_home_about_post['thebusiness-home-about-pages-ids'] ){ $thebusiness_home_about_posts_ids[] = $thebusiness_home_about_post['thebusiness-home-about-pages-ids']; } } if( !empty( $thebusiness_home_about_posts_ids )){ $thebusiness_home_about_args = array( 'post_type' => 'page', 'post__in' => $thebusiness_home_about_posts_ids, 'posts_per_page' => $thebusiness_home_about_number, 'orderby' => 'post__in' ); } } } // the query if( !empty( $thebusiness_home_about_args )){ $thebusiness_home_about_contents_array = array(); /*again empty array*/ $thebusiness_home_about_post_query = new WP_Query( $thebusiness_home_about_args ); if ( $thebusiness_home_about_post_query->have_posts() ) : $i = 1; while ( $thebusiness_home_about_post_query->have_posts() ) : $thebusiness_home_about_post_query->the_post(); $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-title'] = get_the_title(); if (has_excerpt()) { $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-content'] = get_the_excerpt(); } else { $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-content'] = thebusiness_words_count( $thebusiness_home_about_single_words ,get_the_content()); } $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-link'] = get_permalink(); if(isset( $thebusiness_icons_arrays[$i] )){ $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-page-icon'] = $thebusiness_icons_arrays[$i]['thebusiness-home-about-page-icon']; } else{ $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-page-icon'] = 'fa-desktop'; } $thebusiness_home_about_contents_array[$i]['thebusiness-home-about-page-link-text'] = __('Know More','thebusiness'); $i++; endwhile; wp_reset_postdata(); endif; } return $thebusiness_home_about_contents_array; } endif; if ( ! function_exists( 'thebusiness_home_about' ) ) : /** * about Section * * @since thebusiness 1.0.0 * * @param null * @return null * */ function thebusiness_home_about() { global $thebusiness_customizer_all_values; if( 1 != $thebusiness_customizer_all_values['thebusiness-home-about-enable'] ){ return null; } $thebusiness_home_about_selection_options = $thebusiness_customizer_all_values['thebusiness-home-about-selection']; $thebusiness_about_arrays = thebusiness_home_about_array( $thebusiness_home_about_selection_options ); if( is_array( $thebusiness_about_arrays )){ $thebusiness_home_about_number = absint($thebusiness_customizer_all_values['thebusiness-home-about-number']); $thebusiness_home_about_title = $thebusiness_customizer_all_values['thebusiness-home-about-title']; $thebusiness_home_about_sub_title = $thebusiness_customizer_all_values['thebusiness-home-about-sub-title']; $thebusiness_home_about_feature_image = $thebusiness_customizer_all_values['thebusiness-home-about-image']; $thebusiness_home_about_button_text = $thebusiness_customizer_all_values['thebusiness-home-about-button-text']; ?>