'page', 'post__in' => $business_craft_home_service_posts_ids, 'posts_per_page' => 3, 'orderby' => 'post__in' ); } } // the query if( !empty( $business_craft_home_service_args )) { $business_craft_home_service_contents_array = array(); /*again empty array*/ $business_craft_home_service_post_query = new WP_Query( $business_craft_home_service_args ); if ( $business_craft_home_service_post_query->have_posts() ) : $i = 0; while ( $business_craft_home_service_post_query->have_posts() ) : $business_craft_home_service_post_query->the_post(); $business_craft_home_service_contents_array[$i]['business-craft-our-service-title'] = get_the_title(); $business_craft_home_service_contents_array[$i]['business-craft-our-service-content'] = business_craft_words_count( $business_craft_home_Service_word_count ,get_the_content()); $business_craft_home_service_contents_array[$i]['business-craft-our-service-link'] = get_permalink(); $thumb_image = ''; if(has_post_thumbnail()) { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); $thumb_image = $thumb['0']; } $business_craft_home_service_contents_array[$i]['business-craft-our-service-image'] = $thumb_image; if(isset( $business_craft_icons_arrays[$i] )) { $business_craft_home_service_contents_array[$i]['business-craft-our-service-icon'] = $business_craft_icons_arrays[$i]; } else { $business_craft_home_service_contents_array[$i]['business-craft-our-service-icon'] = 'fa-desktop'; } if (isset( $business_craft_icon_color_arrays[$i] )) { $business_craft_home_service_contents_array[$i]['business-craft-our-service-icon-color'] =$business_craft_icon_color_arrays[$i]; } else { $business_craft_home_service_contents_array[$i]['business-craft-our-service-icon-color'] ='#151915'; } $i++; endwhile; wp_reset_postdata(); endif; } return $business_craft_home_service_contents_array; } endif; if ( ! function_exists( 'business_craft_home_service_section' ) ) : /** * Featured Slider * * @since business-craft 1.0.0 * * @param null * @return null * */ function business_craft_home_service_section() { global $business_craft_customizer_all_values; if( 1 != $business_craft_customizer_all_values['business-craft-our-service-enable'] ) { return null; } $business_craft_service_arrays = business_craft_our_service_array( ); if( is_array( $business_craft_service_arrays )) { $business_craft_service_mian_title = $business_craft_customizer_all_values['business-craft-main-title-text']; $bsuiness_craft_service_number = $business_craft_customizer_all_values['business-craft-select-number-page']; ?>