'adela-widget-product-item', 'description' => esc_html__( 'Adela widget products item.', 'adela' ), ); parent::__construct( 'adela_widget_product_item', esc_html__( 'Adela: Product item', 'adela' ), $widget_ops ); } function widget( $args, $instance ){ $instance = wp_parse_args( $instance, array( 'product_id' => 0, 'thumbnail_width' => 270, 'thumbnail_height' => 270, ) ); $args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'p' => $instance['product_id'] ); $loop_posts = new WP_Query( apply_filters( 'adela_widget_product_carousel_query_args', $args ) ); if ( $loop_posts->have_posts() ){ ?>
have_posts() ) { $loop_posts->the_post(); ?>
>
'product', 'posts_per_page' => -1, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, ); $all_product = new WP_Query( apply_filters( 'adela_widget_product_carousel_query_args', $args ) ); ?>