'product', 'posts_per_page' => $shop_number_of_product, 'post_status' => 'publish' ); if( $product_type == 'custom' ){ $args = ''; $args = array( 'post_type' => 'product', 'posts_per_page' => $shop_number_of_product, 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $custom_product, ), ), ); }elseif( $product_type == 'popular-products' ){ $args['meta_key'] = 'total_sales'; $args['order_by'] = 'meta_value_num'; }elseif( $product_type == 'sale-products' ){ $args['meta_query'] = WC()->query->get_meta_query(); $args['post__in'] = array_merge(array(0), wc_get_product_ids_on_sale()); }else{ $args['orderby'] = 'date'; $args['order'] = 'DESC'; } $qry = new WP_Query( $args ); if( $qry->have_posts() || $section_title || $section_content ){ ?>
' . esc_html( $section_title ) . ''; if( $section_content ) echo '
' . wp_kses_post( wpautop( $section_content ) ) . '
'; ?>
have_posts() ){ ?>