0 ){ $thebusiness_home_team_args = array( 'post_type' => 'post', 'posts_per_page' => $thebusiness_home_team_number, 'cat' => $thebusiness_home_team_category, ); } }else { $thebusiness_home_team_posts = salient_customizer_get_repeated_all_value(4 , $repeated_page); $thebusiness_home_team_posts_ids = array(); if( null != $thebusiness_home_team_posts ) { foreach( $thebusiness_home_team_posts as $thebusiness_home_team_post ) { if( $thebusiness_home_team_post['thebusiness-home-team-pages-ids'] > 0 ){ $thebusiness_home_team_posts_ids[] = $thebusiness_home_team_post['thebusiness-home-team-pages-ids']; } } if( !empty( $thebusiness_home_team_posts_ids )){ $thebusiness_home_team_args = array( 'post_type' => 'page', 'post__in' => $thebusiness_home_team_posts_ids, 'posts_per_page' => $thebusiness_home_team_number, 'orderby' => 'post__in' ); } } } // the query if( !empty( $thebusiness_home_team_args )){ $thebusiness_home_team_contents_array = array(); /*again empty array*/ $thebusiness_home_team_post_query = new WP_Query( $thebusiness_home_team_args ); if ( $thebusiness_home_team_post_query->have_posts() ) : $i = 1; while ( $thebusiness_home_team_post_query->have_posts() ) : $thebusiness_home_team_post_query->the_post(); $thebusiness_home_team_contents_array[$i]['thebusiness-home-team-title'] = get_the_title(); $thebusiness_home_team_contents_array[$i]['thebusiness-home-team-link'] = get_permalink(); $url =''; if(has_post_thumbnail()){ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'thebusiness-team-post' ); $url = $thumb['0']; } else{ $url = NULL; } $thebusiness_home_team_contents_array[$i]['thebusiness-home-team-page-image'] = $url; $i++; endwhile; wp_reset_postdata(); endif; } return $thebusiness_home_team_contents_array; } endif; if ( ! function_exists( 'thebusiness_home_team' ) ) : /** * Team section * * @since thebusiness 1.0.0 * * @param null * @return null * */ function thebusiness_home_team() { global $thebusiness_customizer_all_values; if( 1 != $thebusiness_customizer_all_values['thebusiness-home-team-enable'] ){ return null; } $thebusiness_home_team_selection_options = $thebusiness_customizer_all_values['thebusiness-home-team-selection']; $thebusiness_team_arrays = thebusiness_home_team_array( $thebusiness_home_team_selection_options ); if( is_array( $thebusiness_team_arrays )){ $thebusiness_home_team_number = absint($thebusiness_customizer_all_values['thebusiness-home-team-number']); $thebusiness_home_team_title = $thebusiness_customizer_all_values['thebusiness-home-team-title']; $thebusiness_home_team_button_text = $thebusiness_customizer_all_values['thebusiness-home-team-button-text']; $thebusiness_home_team_button_link = $thebusiness_customizer_all_values['thebusiness-home-team-button-link']; $thebusiness_home_team_single_words = absint($thebusiness_customizer_all_values['thebusiness-home-team-single-words']); ?>