'post', 'post_status' => 'publish', 'posts_per_page' => bloghash_option( 'popular_post_number' ), // phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page 'order' => $bloghash_popular_post_order[1], 'orderby' => $bloghash_popular_post_order[0], 'ignore_sticky_posts' => true, 'tax_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote' ), 'operator' => 'NOT IN', ), ), ); if ( ! empty( $bloghash_popular_post_categories && $bloghash_popular_post_data_source == 'category' ) ) { $bloghash_args['category_name'] = implode( ', ', $bloghash_popular_post_categories ); } elseif ( ! empty( $bloghash_popular_post_posts && $bloghash_popular_post_data_source == 'post' ) ) { $bloghash_args['post_name__in'] = $bloghash_popular_post_posts; } $bloghash_args = apply_filters( 'bloghash_popular_post_query_args', $bloghash_args ); $bloghash_posts = new WP_Query( $bloghash_args ); // No posts found. if ( ! $bloghash_posts->have_posts() ) { return; } $bloghash_popular_post_elements = (array) bloghash_option( 'popular_post_elements' ); $bloghash_posts_per_page = 'col-md-' . ceil( esc_attr( 12 / $bloghash_args['posts_per_page'] ) ) . ' col-sm-6 col-xs-12'; $count = 0; // Initialize counter while ( $bloghash_posts->have_posts() ) : $bloghash_posts->the_post(); $count++; // Increment counter // Post items HTML markup. ob_start(); ?>