__( 'Featured 1', 'bizbuzz' ), 'content' => __( 'Quisque velit nisi, pretium ut lacinia in, elementum id enim. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi.', 'bizbuzz' ), 'link' => '#', ), array( 'title' => __( 'Featured 2', 'bizbuzz' ), 'content' => __( 'Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Pellentesque in ipsum id orci porta dapibus.', 'bizbuzz' ), 'link' => '#', ), array( 'title' => __( 'Featured 3', 'bizbuzz' ), 'content' => __( 'Nulla porttitor accumsan tincidunt. Curabitur aliquet quam id dui posuere blandit.', 'bizbuzz' ), 'link' => '#', ), ); $page_ids = array(); for ( $i = 1; $i <= 3; $i++ ) { $page_id = isset( $options[ 'featured_post_' . $i ] ) ? $options[ 'featured_post_' . $i ] : ''; if ( ! $page_id ) { continue; } $page_ids[] = $page_id; } if ( ! empty( $page_ids ) ) { $services_args = array( 'post_type' => 'post', 'post__in' => $page_ids, 'posts_per_page' => 3, 'orderby' => 'post__in', 'ignore_sticky_posts' => 1, ); $service_post_query = new WP_Query( $services_args ); if ( $service_post_query->have_posts() ) : $i = 0; while ( $service_post_query->have_posts() ) : $service_post_query->the_post(); $title = get_the_title(); $content = get_the_content(); if ( ! empty( $title ) ) { $services_data[ $i ]['title'] = $title; } if ( ! empty( $content ) ) { $services_data[ $i ]['content'] = get_the_excerpt(); } $services_data[ $i ]['link'] = get_permalink(); $services_data[ $i ]['ID'] = get_the_ID(); $services_data[ $i ]['thumbnail_url'] = bizbuzz_get_post_thumbnail_url( get_the_ID(), 'bizbuzz-thumbnail' ); $i++; endwhile; wp_reset_postdata(); endif; } return $services_data; } }