'all', 'expert_id' => 'no_expert', 'category_id' => 'no_category', 'product_tag_id' => 'no_tag', 'view_type' => 'featured_products_carousel', 'auto' => '0', 'per_page' => '-1', 'per_row' => 4, 'order' => 'DESC', 'orderby' => 'date', 'hide_price' => false, 'hide_rating' => false, 'hide_comments' => false, 'price_bg' => '#48a7d4', 'free_price_bg' => '#eab830', 'css' => '' ), $atts)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css, ' ')); if ($view_type == 'featured_products_carousel') { wp_enqueue_script('owl.carousel'); wp_enqueue_style('owl.carousel'); stm_module_scripts('featured_products'); } stm_module_styles('featured_products'); // All args for extract all products $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => $per_page, ); if (!empty($category_id) and $category_id != 'no_category') { $args['product_cat'] = $category_id; } if (!empty($product_tag_id) and $product_tag_id != 'no_tag') { // ALP for filtering STM products by tags $args['product_tag'] = $product_tag_id; } $args['meta_query'][] = array( 'key' => '_stock_status', 'value' => 'instock', ); // Get featured products if ($meta_key == '_featured') { $args['meta_query'][] = array( 'key' => '_featured', 'value' => 'yes', ); } elseif ($meta_key == 'expert' and $meta_key != 'no_expert') { $args['meta_query'][] = array( 'key' => 'course_expert', 'value' => $expert_id, 'compare' => 'LIKE' ); } $featured_query = new WP_Query($args); $featured_product_num = stm_create_unique_id($atts); $cols_per_row = 12 / $per_row; ?> have_posts()): ?>