How to display woocommerce products Add to cart button in Custom Wordpress query.
Hi,I just run Custom wordpress query for Woocommerce products. But i am not sure how to display product add to cart button inside the loop. Can anyone please help me out of this? Below is my query which i used to fetch products.
$args = array(
'post_type' => 'product',
'posts_per_page' => '4',
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
);
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post();
if ( has_post_thumbnail() ) { the_post_thumbnail(); }
the_title();
endwhile; endif;
Please help me out of this.
Many Thanks
Oct 28, 2017
Wordpress Bugs