Created
January 5, 2016 11:27
-
-
Save rajeebbanstola/c337a70dd952d61dd8b4 to your computer and use it in GitHub Desktop.
Revisions
-
rajeebbanstola created this gist
Jan 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php $args = array( 'post_type' => 'product', 'orderby' => 'title', 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $category ), ), 'posts_per_page' => $product_number ); $featured_query = new WP_Query( $args ); while ($featured_query->have_posts()) : $featured_query->the_post(); $product = get_product( $featured_query->post->ID ); // By doing this, we will be able to fetch all information related to single WooCommerce Product endwhile; wp_reset_query();