bluvertigo
8/26/2015 - 10:32 AM

wp_query product woocommerce

wp_query product woocommerce

<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 100,
'ID' => '254'
);
$loop = new WP_Query($args);

while ($loop->have_posts()):
$loop->the_post();
global $product;
echo '<br /><a href="' . get_permalink() . '">' . woocommerce_get_product_thumbnail() . ' ' . the_title() . ' ' . the_content() . ' ' . get_post_meta(get_the_ID() , '_regular_price', true) . ' ' . get_post_meta(get_the_ID() , '_sale_price', true) . '</a>';
endwhile;
wp_reset_query();
?>