If these products came from WooCommerce, then most probably you’re using wrong taxonomy in your code.
WC products use product_cat taxonomy as categories, so you can’t use built-in categories to filter them.
Use this instead
'product_cat' => 'category-slug-here',
and it should work correctly.
Related Posts:
- How to override admin-bar style
- How to fix a theme with page.php Default Template that accidentally deleted?
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- How to remove howdy dropdown menu content
- How to auto refresh when user change postcode
- How to add custom metakey to shop_order page’s searching function?
- Changing the HTML of notices in WooCommerce [closed]
- WP Enqueue Script Error
- Which template file to edit to edit homepage in Mystile [closed]
- How to influence the information displayed on widget inside wp-admin
- How to get woocommerce inventory status [closed]
- How do I create a new WP admin color scheme?
- AJAX handler throws 400 (Bad request) – why?
- Apply jquery script to only woocommerce product pages and categories
- How can I add an extra WooCommerce hook
- Replacing select2 in admin backend for all selects
- difference between add_object_page and add_menu_page
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- How can I rename the WordPress AJAX URL? [duplicate]
- display 100 products per page on product category page [closed]
- Can I use require() function in a template file?
- Adding WooCommerce to a Custom Theme – not working [closed]
- Dequeue script in template isn’t working
- Exclude Empty Child Categories in Menu
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- Adjust which tempalte a page uses with a function?
- change billing and shipping address 1 and 2 field placeholders [closed]
- Make “sidebar template” the default template for new pages
- Custom roles can’t access to wp-admin
- Override woocommerce wc-class function
- password protected post policy
- WordPress function for 1 to for many
- Attach parent category template to all subcategories
- Pass parameters to function through an action
- Add class or ID to any WordPress function
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- Display Password Protected external RSS in wordpress template
- How to enable template page only for a post id page
- Calling a function from anywhere, used in different places
- How to change login labels
- Modify a function without editing template
- I want to get product attirbute in the section below
- Load Woocommerce and WordPress Functions Outside
- How to force field validation first, then its values saved durning edit profile?
- Add to cart php not working [closed]
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- When sale price is 0.00 show only regular price
- how can I edit flexslider in woocommerce. [Urgent]
- Sections and tabs DRY – WordPress settings API
- Functions For Calling Specific Elements
- Full page template function
- Wp admin – Set default value to 999 in comments
- help I changed one currency in woocommerce and everything is ruined [closed]
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Add Element as a Filter to the_content
- How to remove comment count column in Posts inside the admin dashboard?
- (Woocommerce) Order by price when entering specific category
- Need print logo without any ID & class
- Define PHP variable from a seperate API if statement
- attachment page template? only show attachments for current post?
- Sortable column (by numbers) in admin users
- Create custom function for hero image
- add_filter to specific WooCommerce Category
- error at login page in wordpress
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Delay a function, any function!
- Specify multiple categories for custom post template – FATAL ERROR
- Best way to disable sidebars on posts (only)?
- How to make a new function that includes a template
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- How to change a meta value (of a published post) after X days.?
- Render page with specific id from functions.php
- Block all plug-ins from initiating redirection upon activation?
- the_date() and the_time() functions display actual date an time instead of published date and time
- Show ‘Add to Cart’ on Out of Stock products
- removing description tabs – single product page – breaks footer
- Link product attribute value to a URL – woocommerce
- When are the user meta fields created in the database? Admin vs Woo API REST
- Unable to login after registration
- is_product_category(‘Services’) not working
- Parent category as WOOCommerce Categories widget title
- Woocommerce Display Discount On cart
- Problem with my footer after changing WooCommerce Products Sorting [closed]
- Insert Modal on user first login
- More than one search results page template for two searches on site
- Execute jQuery with custom event listener after successfully add an item to the cart
- Show number of sold products but be first for less than 2
- function syntax is off,
- admin-ajax.php & my wp-admin folder url showing in header
- Newest comments first not working
- Retrieve a custom form field modified by a filter
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Allow the access over wp-login.php
- Display post_meta-by_key on product catalogue
- Woocommerce – Checkout error message
- Creating mixture of shortcodes to use in the visual/text editor
- “woocommerce_output_related_products” not working
- My website is generating weired url parameters of paginated pages
- woocommerce_sort_product_tabs() expects an array
- sort by date in users