'post', 'cat' => $thebusiness_home_service_category, 'posts_per_page' => $thebusiness_home_service_number ); } }else { $thebusiness_home_service_posts = salient_customizer_get_repeated_all_value(3 , $thebusiness_home_service_page); $thebusiness_home_service_posts_ids = array(); if( null != $thebusiness_home_service_posts ) { foreach( $thebusiness_home_service_posts as $thebusiness_home_service_post ) { if( 0 != $thebusiness_home_service_post['thebusiness-home-service-pages-ids'] ){ $thebusiness_home_service_posts_ids[] = $thebusiness_home_service_post['thebusiness-home-service-pages-ids']; } } if( !empty( $thebusiness_home_service_posts_ids )){ $thebusiness_home_service_args = array( 'post_type' => 'page', 'post__in' => $thebusiness_home_service_posts_ids, 'posts_per_page' => $thebusiness_home_service_number, 'orderby' => 'post__in' ); } } } // the query if( !empty( $thebusiness_home_service_args )){ $thebusiness_home_service_contents_array = array(); /*again empty array*/ $thebusiness_home_service_post_query = new WP_Query( $thebusiness_home_service_args ); if ( $thebusiness_home_service_post_query->have_posts() ) : $i = 1; while ( $thebusiness_home_service_post_query->have_posts() ) : $thebusiness_home_service_post_query->the_post(); $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-title'] = get_the_title(); if (has_excerpt()) { $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-content'] = get_the_excerpt(); } else { $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-content'] = thebusiness_words_count( $thebusiness_home_service_single_words ,get_the_content()); } $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-link'] = get_permalink(); if(isset( $thebusiness_icons_arrays[$i] )){ $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-page-icon'] = $thebusiness_icons_arrays[$i]['thebusiness-home-service-page-icon']; } else{ $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-page-icon'] = 'fa-desktop'; } $thebusiness_home_service_contents_array[$i]['thebusiness-home-service-page-link-text'] = __('Know More','thebusiness'); $i++; endwhile; wp_reset_postdata(); endif; } return $thebusiness_home_service_contents_array; } endif; if ( ! function_exists( 'thebusiness_home_service' ) ) : /** * Service Section * * @since thebusiness 1.0.0 * * @param null * @return null * */ function thebusiness_home_service() { global $thebusiness_customizer_all_values; if( 1 != $thebusiness_customizer_all_values['thebusiness-home-service-enable'] ){ return null; } $thebusiness_home_service_selection_options = $thebusiness_customizer_all_values['thebusiness-home-service-selection']; $thebusiness_service_arrays = thebusiness_home_service_array( $thebusiness_home_service_selection_options ); if( is_array( $thebusiness_service_arrays )){ $thebusiness_home_service_number = absint($thebusiness_customizer_all_values['thebusiness-home-service-number']); $thebusiness_home_service_title = $thebusiness_customizer_all_values['thebusiness-home-service-title']; $thebusiness_home_service_button_text = $thebusiness_customizer_all_values['thebusiness-home-service-button-text']; ?>