'post', 'cat' => $thebusiness_feature_slider_category, 'ignore_sticky_posts' => true ); } } else{ $thebusiness_feature_slider_posts = salient_customizer_get_repeated_all_value(3 , $repeated_page); $thebusiness_feature_slider_posts_ids = array(); if( null != $thebusiness_feature_slider_posts ) { foreach( $thebusiness_feature_slider_posts as $thebusiness_feature_slider_post ) { if( 0 != $thebusiness_feature_slider_post['thebusiness-fs-pages-ids'] ){ $thebusiness_feature_section_posts_ids[] = $thebusiness_feature_slider_post['thebusiness-fs-pages-ids']; } } if( !empty( $thebusiness_feature_section_posts_ids )){ $thebusiness_feature_slider_args = array( 'post_type' => 'page', 'post__in' => $thebusiness_feature_section_posts_ids, 'posts_per_page' => $thebusiness_feature_slider_number, 'orderby' => 'post__in' ); } } } if( !empty( $thebusiness_feature_slider_args )){ // the query $thebusiness_fature_section_post_query = new WP_Query( $thebusiness_feature_slider_args ); if ( $thebusiness_fature_section_post_query->have_posts() ) : $i = 0; while ( $thebusiness_fature_section_post_query->have_posts() ) : $thebusiness_fature_section_post_query->the_post(); $url =''; if(has_post_thumbnail()){ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'thebusiness-main-banner' ); $url = $thumb['0']; } $thebusiness_feature_slider_contents_array[$i]['thebusiness-feature-slider-title'] = get_the_title(); if (has_excerpt()) { $thebusiness_feature_slider_contents_array[$i]['thebusiness-feature-slider-content'] = get_the_excerpt(); } else { $thebusiness_feature_slider_contents_array[$i]['thebusiness-feature-slider-content'] = thebusiness_words_count( $thebusiness_feature_slider_single_words ,get_the_content()); } $thebusiness_feature_slider_contents_array[$i]['thebusiness-feature-slider-link'] = get_permalink(); $thebusiness_feature_slider_contents_array[$i]['thebusiness-feature-slider-image'] = $url; if ($i == 0) { $thebusiness_feature_slider_contents_array[$i]['thebusiness-slider-class'] = 'active'; } else{ $thebusiness_feature_slider_contents_array[$i]['thebusiness-slider-class'] = 'inactive'; } $i++; endwhile; wp_reset_postdata(); endif; } return $thebusiness_feature_slider_contents_array; } endif; if ( ! function_exists( 'thebusiness_featured_home_slider' ) ) : /** * Featured Slider * * @since thebusiness 1.0.0 * * @param null * @return null * */ function thebusiness_featured_home_slider() { global $thebusiness_customizer_all_values; if( 1 != $thebusiness_customizer_all_values['thebusiness-feature-slider-enable'] ){ return null; } $thebusiness_feature_slider_selection_options = $thebusiness_customizer_all_values['thebusiness-featured-slider-selection']; $thebusiness_slider_arrays = thebusiness_featured_slider_array( $thebusiness_feature_slider_selection_options ); if( is_array( $thebusiness_slider_arrays )){ $thebusiness_feature_slider_number = absint( $thebusiness_customizer_all_values['thebusiness-featured-slider-number'] ); $thebusiness_feature_enable_arrow = $thebusiness_customizer_all_values['thebusiness-fs-enable-arrow']; $thebusiness_feature_enable_button = $thebusiness_customizer_all_values['thebusiness-fs-enable-button']; $thebusiness_feature_button_text = $thebusiness_customizer_all_values['thebusiness-fs-button-text']; ?>