'product', 'posts_per_page' => get_theme_mod('products_onsell_number_of_products',8), 'tax_query' => array( array( 'taxonomy' => 'product_visibility', 'field' => 'name', 'terms' => 'exclude-from-catalog', 'operator' => 'NOT IN' ) ), 'meta_query' => array( 'relation' => 'OR', array( // Simple products type 'key' => '_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric' ), array( // Variable products type 'key' => '_min_variation_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric' ), ) ); $query = new WP_Query($on_sale); if($query->have_posts()) { while($query->have_posts()) { $query->the_post(); ?>