<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
- Wp get all the sub pages of the parent using wp query
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- How to uniquely identify queries?
- Get posts by meta data OR title
- WP_Query ordered by custom field that is a date string?
- Duplicate Queries
- Highlighting Sub topic in a post?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to count post type that has a particular term?
- Retrieve products with specific attribute and in category – woocommerce
- How to combine tax_query and date_query in WordPress
- Using AJAX to return search form results
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- WP_Query Performance Issues with meta_query
- WordPress custom archive page
- Query Set Order By Author
- Why is this coming back as null? Thats wrong. There is one post
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- How to do a query on custom taxonomies that is uncategorised?
- How do I search inside specific taxonomies in WordPress
- How to orderby meta_value_num with dollar ($) sign
- How to correctly pass values to wpdb->prepare()?
- Query: offset post list, unless it’s a specific category
- Setting get_queried_object
- Woocommerce returns Product post_status as published even tho it is in status draft
- remove query arg from url after set query
- difference between like ‘%%%var%%’ and ‘%var%’
- showing all search result in one template
- Sort query by author: 1 author, then others
- Custom Query num_rows returns wrong amount
- Overwrite YoastSEO meta-tags with another page’s [closed]
- Take all produts by category
- How to orderby multiple meta fields if some fields are empty
- How to get all product attributes for filters in WooCommerce?
- Import wp users via one click demo option
- Slow queries on a huge database
- WP_Query with ‘rand’, but equal number of posts from the taxonomy terms given
- Query with relation and one without relation using multiple taxonomies?
- Redirect to another page using contact form 7? [closed]
- Sort WordPress Posts Meta value by Week not Day
- 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?
- Get multiple users with meta value in one query and populate WP_User class
- Wp_query with 2 meta keys and array of meta values
- How to order WP_Query to group results?
- Redirect Search to Form When No Product Results Are Found
- How to display SQL query that ran in WC_Order_Query?
- WP_Query Taxonomy categories filtering
- Problem with get_page_by_path() using with WP_Query
- Query where ANDing slug values not working
- 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
- Assign a minimum result count for WooCommerce query shortcodes?
- WP_Query to get post on frontpage
- Unlimited Page Sitemap Link
- Writing less unnecessary code with WordPress
- How to SQL query posts IDs by categories AND authors?
- $wp_query->found_posts not returning correct value
- Query multiple post types, but different order for each
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- ElasticPress is (aparently) messing with my search filters
- Any way to use FETCH_KEY_PAIR with $wpdb?
- Get categories within specific term
- How to get_comments() ordered by date and parent?
- WP Query. Ordering posts by another post types meta
- How to display author meta and count numbers for each user in comment.php?
- Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?
- Woocomerce – Order products by float attribute in archive pages
- Not able to fetch woocommerce variation sales products for particular category products
- Global page ID variable empty error
- How to make a search query if not found in post table then search in postmeta table?
- Adding Category in WP_Query Not Working
- Merge two queries and remove duplicate
- Woocommerce WP_Query post__not_in problem
- how to show more than 1 post into three columns query
- How can I get all the posts that are related with a specific taxonomy term?
- Fetch only categorized posts
- Custom pagination (Title, date and teaser)
- Get a list of the last posts grouped by author and filtered by category
- When should you use WP_Query vs query_posts() vs get_posts()?
- How to query post ids liked by the Author
- Modify query after meta value
- Showing posts from 4 categories along with all latest posts
- WP_Query issues with argument posts_per_page
- Use meta query only 3 or more results?
- Search results stuck on page 1
- Use value from meta key array for use in WP_Query