'post', 'post_status' => 'publish', 'posts_per_page' => bloghash_option( 'hero_slider_post_number' ), // phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page 'order' => $bloghash_hero_slider_order[1], 'orderby' => $bloghash_hero_slider_order[0], 'ignore_sticky_posts' => true, ); $tax_query = array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote' ), 'operator' => 'NOT IN', ), ); $bloghash_hero_categories = array_filter( array_map( 'absint', (array) bloghash_option( 'hero_slider_category' ) ) ); // If categories are specified if ( ! empty( $bloghash_hero_categories ) ) { $tax_query[] = array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $bloghash_hero_categories, 'operator' => 'IN', ); } $bloghash_args['tax_query'] = $tax_query; $bloghash_args = apply_filters( 'bloghash_hero_slider_query_args', $bloghash_args ); $bloghash_posts = new WP_Query( $bloghash_args ); // No posts found. if ( ! $bloghash_posts->have_posts() ) { return; } $bloghash_hero_items_html = ''; $bloghash_hero_elements = (array) bloghash_option( 'hero_slider_elements' ); $bloghash_hero_readmore = isset( $bloghash_hero_elements['read_more'] ) && $bloghash_hero_elements['read_more'] ? ' bloghash-hero-readmore' : ''; $bloghash_hero_read_more_text = bloghash_option( 'hero_slider_read_more' ); // Hero container. $bloghash_hero_container = bloghash_option( 'hero_slider_container' ); $bloghash_hero_container = 'full-width' === $bloghash_hero_container ? 'bloghash-container bloghash-container__wide' : 'bloghash-container'; $bloghash_hero_slider_align = bloghash_option( 'hero_slider_align' ); $bloghash_classes = array( $bloghash_hero_slider_align, $bloghash_hero_readmore, ); $bloghash_classes = implode( ' ', $bloghash_classes ); while ( $bloghash_posts->have_posts() ) : $bloghash_posts->the_post(); // Post items HTML markup. ob_start(); ?>