Created
April 4, 2016 23:01
-
-
Save huypn/03713ffaec98a31325d63d01b1b70d5c to your computer and use it in GitHub Desktop.
This file contains 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 characters
$args = array( | |
'post_type' => 'product', | |
'meta_key' => '_featured', | |
'meta_value' => 'yes', | |
'posts_per_page' => 4 | |
); | |
$featured_query = new WP_Query( $args ); | |
if ($featured_query->have_posts()) : | |
while ($featured_query->have_posts()) : | |
$featured_query->the_post(); | |
$product = get_product( $featured_query->post->ID ); | |
// Output product information here | |
endwhile; | |
endif; | |
wp_reset_query(); // Remember to res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment