woocommerce categories are not a “category” they’re the product_cat
taxonomy. change your args like so:
$params = array(
'posts_per_page' => 5,
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => 'cap'
)
)
);
Related Posts:
- get product attributes for current product and store it in a variable
- Woocommerce, recognize the loop of related products
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- How to select WooCommerce products by post_meta and order them
- Woocommerce : Can’t get product info in loop
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- Display all categories including sub categories under a list ul
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Display product attributes for current product
- Woocommerce linking variations
- How to correctly add Javascript in functions.php
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Woocommerce: How to override core functions in functions.php?
- Looping through WP_Post Object
- Get WooCommerce shipping methods programmatically
- Translating add to cart woocommerce button [closed]
- Add attribute / custom attribute to product in woocommerce
- Show Custom Taxonomy Title
- spliting posts into two columns
- Help with some php math in WordPress
- combine Code 1 with Code 2
- Changing layout with wp_customise
- Adding nofollow to a PHP generated Nav
- Two Different Links for Same Product – WooCommerce [closed]
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Show prices with tax in Woocommerce Mini Cart [closed]
- Problem with custom plugin using AJAX to pull info from php file
- Reload part of checkout on changed shipping method
- Woocommerce related product text
- get author_name from queried post
- how to fix error “called incorrectly, should not be accessed directly”?
- How to auto fetch customer details in Woocommerce in checkout page
- I want to add custom add to cart link [closed]
- How to add condition in wordpress loop? [closed]
- Validation algorithm in checkout field
- Alert Bar section within WP loop is displaying even though there are no posts
- Load wordpress content in other domain
- How to avoid duplicates when creating recent network posts
- Can a plugin redirect product page based on IF condition?
- Remove page title in product page using a function
- woocommerce specific quantities for product
- Why my loop isn’t working? [closed]
- Get all posts as an array ID => Name
- woocommerce related product title length
- How to get post ID from button and pass title to Modal
- Do not duplicate posts with multiple categories in multiple loops
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- Woocommerce custom Plugin in wordpress [closed]
- WordPress loop is not working
- Problem in replacing the_content with the_excerpt()
- How to separate product payment and shipping payment in WooCommerce checkout? [closed]
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Output product category link from WP_Query
- Variation prices breakdown only for single product page
- Set all WooCommerce Products to Simple, Virtual & Downloadable
- Pagination contents not changing in Front page WordPress
- Undefined array key 0 wp-includes/capabilities.php on line 76
- How do I know if the user is a customer?
- I want to fusion the product columns in email table order
- WooCommerce is_product_category() not working
- Best way to use variables in multiple functions?
- How do I programmatically add ‘reviews_allowed’ to WooCommerce product?
- Where does php code to load data go?
- Get product price in a different currency using WooCommerce Currency Switcher
- Adding product permalink on admin order page throwing error
- Latest posts feed with a specific post always first
- How to override WooCommerce Order Item Meta with data from Cart?
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- Add custom attribute to product’s HTML to woocommerce cart page
- Change WooCommerce template for PDF – access to custom field
- Get all woocommerce product names with price and show using core php
- Add custom ID attribute to all woocommerce products on archive pages
- How can i put php code on the wordpress page?
- How fix error in the WordPress loop?
- How to detect if a revision was made by woocommerce or wordpress?
- Efficient way of querying for a “fallback” post?
- How do I prevent a folder from reappearing in my home directory?
- jQuery doesn’t work in my php snippet
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- Use WP_Query Data In Cookie
- Pagenav Not appearing on custom Template
- Remove the_content From Loop
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- How to add custom checkout field in user details mail template
- Pagination in category.php not functioning
- Display Sale Price Before Regular Price (WooCommerce)
- Setting WooCommerce currency programmatically
- How to handle parent and child pages?
- How to create a loop that will display one post and stop?
- How to create a container in php then customise it in CSS
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- Why does WordPress not send the user the email to add a password?
- Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Woocommerce Variations?