$attributes['postType'] ?? 'post', 'posts_per_page' => $attributes['numPosts'] ?? 5, ); if ( ! empty( $attributes['category'] ) ) { $args['tax_query'] = array( array( 'taxonomy' => $attributes['taxonomy'] ?? 'category', 'field' => 'slug', 'terms' => $attributes['category'], ), ); } $args = apply_filters( 'ait_blocks_slider_query_args', $args, $attributes['anchor'] ?? '' ); $query = new WP_Query( $args ); $data_attributes = array(); foreach ( $attributes as $k => $v ) { if ( 'autoplay' === $k ) { $data_attributes[] = sprintf( 'data-autoplay="%s"', $v ? 'true' : 'false' ); } elseif ( 'navDots' === $k ) { $data_attributes[] = sprintf( 'data-nav-dots="%s"', $v ? 'true' : 'false' ); } elseif ( 'navButtons' === $k ) { $data_attributes[] = sprintf( 'data-nav-buttons="%s"', $v ? 'true' : 'false' ); } elseif ( 'interval' === $k ) { $data_attributes[] = sprintf( 'data-interval="%d"', $v ?? 3000 ); } } ?> have_posts() ) : ?>
$attributes['anchor'] ?? null, 'class' => 'slider', ) ) ); ?> >
have_posts() ) : $query->the_post(); $thumbnail_url = get_the_post_thumbnail_url( null, $attributes['thumbnailSize'] ?? 'full' ); if ( ! $thumbnail_url ) { continue; } ?>