<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'No products found' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->
Related Posts:
- Query WooCommerce orders where meta data does not exist
- how to retrieve specific product attribute value in an sql query?
- merge two query arguments into one WP_Query call
- Get all products which have both product category
- Check if loop has any categories?
- Woocommerce Get Orders By Meta Value
- Create global array to compare inside a query
- Using the same WP_Query for shop and widgets in WooCommerce shop
- Wp_query WooCommerce products
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- How to use meta_query to retrieve posts from multiple custom post type
- WooCommerce – get product sub categories
- Query posts intersecting tags and categories
- Order by empty custom field
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Slow queries on a huge database
- Having trouble with WooCommerce Storefront child theme single.php “related posts” modification [closed]
- Adding column to wp_posts table or join wp_posts table with another table
- Woocommerce – Changing the order of the upsell products [closed]
- Out Of memory issue on post per page parameter
- Two loops on archive page
- WP_Query with ‘rand’, but equal number of posts from the taxonomy terms given
- Multisite pagination issue by multi query archive 404
- Query with relation and one without relation using multiple taxonomies?
- Include data from custom table in WP_Query
- How to make search for posts using get method?
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- Meta Query relation “AND” then set array accordingly
- How to get a query variable?
- How to get list of posts from permalinks?
- Multiple filter conditions for WP_Query
- date_query seems to be ignored by wp_query
- Is there a reason why Pages are not publicly_queryable?
- Query Page Content From Theme Options?
- WooCommerce search products between price range using WP_Query
- Redirect to another page using contact form 7? [closed]
- Check return value of get_posts
- Better wordpress attachment query than this
- Exclude some authors from query
- wp_query not working with post_type
- Reset WordPress Post Query to default
- Sort WordPress Posts Meta value by Week not Day
- Query only the posts with a post format of “audio”
- Modify Search Query if original Query gave no results
- Is_single() conditional tag returns null in query
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- Transient api Caches confused
- How can I override one post and make it display content for another post?
- Include current post into loop
- What happens to the default query when I use WP_Query?
- Woocommerce – exclude only older out-of-stock items
- Is it possible to query from external database? [duplicate]
- Need Sub-category with main Category
- Woocommerce pagination and result count after custom loop
- How to query woocommerce product by pricing? [closed]
- Can’t sort custom post type by random
- pre_get_posts – Trying to get property of non-object warning
- How to Create a Random List of Child Pages
- Query posts that contain video?
- Get multiple users with meta value in one query and populate WP_User class
- WordPress query posts with multiple post_meta data
- Wp_query with 2 meta keys and array of meta values
- How to order WP_Query to group results?
- Filter post query to only show direct children of category
- Get a list of posts by specific category
- Show a 404 error page if Public query variable’s value doesn’t exist?
- How to check the array values, what WP_Query has brought to me?
- Custom Post Type Query issue
- How to set up hierarchical relationships without using plugins / meta query
- How to add custom meta to ‘pre_get_terms’?
- Set front_page programatically after user login via query, while leaving site option alone
- Can’t fetch Custom Post Type Data through Custom Query
- Redirect Search to Form When No Product Results Are Found
- Shortcode for custom query not returning results when attributes are added
- How do I get Woocommerce product variation name and variation description in a WP_Query?
- How to display SQL query that ran in WC_Order_Query?
- Should I reset $wp_query?
- WP_Query Taxonomy categories filtering
- Exclude a Woocommerce product from WP_Query
- Yoast primary category query modification
- Problem with get_page_by_path() using with WP_Query
- Hide products in uncategorized category from search results
- Query where ANDing slug values not working
- WP_QUERY wrong ammount of posts
- Woo Commerce using WP_Query to get products that match price range, with an additional required product attribute
- How to filter query loop block with a search string from the query parameters
- Update query for wp_posts and wp_postmeta
- Multiple meta_key ordering with pre_get_posts
- How to echo woocommerce category name
- Assign a minimum result count for WooCommerce query shortcodes?
- Get specific ACF key and value from all posts – no access to DB
- mysql query order by
- Woocommerce: order posts by meta key
- WP_Query to get post on frontpage
- Notice thrown when creating numeric pagination on custom query
- var_dump of WP_Query object is not empty, while .have_posts() return false
- wordpress udpate query not equal to
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- WP_Query for products always returns empty
- Write WP Query that selects posts that are part of the same two categories