The solution to my problem was to use:
has_term( 'the-cat-I-want-to-display', 'product_cat' ) || is_product_category( 'the-cat-I-want-to-display' )
This worked. Thanks everyone for your help!
Related Posts:
- Custom page for WooCommerce’s /product-category/
- Template for product-category page [closed]
- category id (term_id) in url instead of slug
- Display All Products by Category with WooCommerce
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Woocommerce get category image full size
- Preventing index.php?category_name=something from redirecting
- Make all subcategories use the template of its category parent?
- Programmatically create product category and add thumbnail in woocommerce
- Different templates for parent and children categories/taxonomies
- Reflect nested categories in appearance > menus
- Create product category and keyword search form in woocommerce? [closed]
- Display only deepest category on a single post?
- Remove child products from woocommerce category page [closed]
- How do I set a specific template for sub-categories?
- How do I edit pre_get_post for the category the user is currently in?
- Exclude a category from the filed under list only on some templates
- Create single.php for specific category by category id
- Display WooCommerce product categories in a 4 columns custom menu [closed]
- How to select product category while adding new product in woocommerce? [closed]
- Use get_term_children to get the sub category of a parent category for the current post
- Hide uncategorized products from the shop page
- Remove word “Category” from WooCommerce product page [closed]
- is_archive() content being shown instead of is_category()
- Filtering search results
- WooCommerce change category url and product base
- How to override Category rendering mechanism
- How to control template resolution if both Author and Category filter in place?
- Which php file lists all the post of a category
- Output link to category from WP_Query loop of woocommerce products
- display woocommerce all category title on home page
- Apply custom category template to subcategories
- Add Icons to the Product Category Sidebar Widget WooCommerce
- Add Product categories to WordPress menu without losing hierarchy
- Display “add to cart” button on every listing in product category page?
- How to get product count with respect to categories in WooComerce
- Code to pull in a PHP file named after the category ID
- Getting categories id for all products in cart
- Get woocommerce catogry
- get_cat_ID() not wokring
- Exclude category from Tag Template
- Display child categories in WooCommerce
- WooCommerce duplicate sub categories and product slugs
- How to make a Thumbnails Mosaic
- Are Category or Tag Archive Pages Possible?
- Possible to make a subdirectory that loops through a single category?
- Need Category RSS Feed that shows all posts
- Set post categories to include parents when setting child category
- Linking products to categories
- Woocommerce category show subcategories only/omit posts for specific category
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Omit specific product categories from WooCommerce shortcode
- products nested by subcategories in a current category archive
- WC 3.x Get categories from variable product of the cart
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Product Category WooCommerce
- Set a them for all subset of category
- How to display only posts assigned to a particular, isolated, subcategory
- Highlight wp_nav_menu when category is selected
- Archive.php filtered by pre-determined category
- one category template for multiple categories
- Hide woocommerce category name from specific pages
- Hide woocommerce category name from specific pages
- need to add custom field in more products
- How to redefine the sorting of product categories by menu_order?
- Different templates for different category tags
- Pagination not visible on woocommerce’s category page
- Pagination is not working properly in Product Category/Tag pages
- Best way of getting WooCommerce category path
- How to recreate a copy of a product category in WooCommerce? [closed]
- Get parrent category name
- Sorting category products not working
- The default code for “posts_nav_link” on category.php isn’t working
- Remove product category placeholder image (Woocomerce)
- Only one post is showing on category page, why?
- Categories for each brands
- Change thumbnail image depending product category
- Unwanted Duplicate Product Categories in WooCommerce
- Woocommerce custom category pages
- Customize WordPress widget – Product Category
- WordPress/Woocommerce only show category in shop to a single role
- WooCommerce – How to show specific category first-rest of products-specific category last
- Woocommerce custom category page with pagination [closed]
- Updating category template to change how subcategories display
- Categories overview that links to page displaying posts
- How can I get categories IDs if multiple categories requested via URI?
- Category template to show different categories based on parent
- Does “show_option_all” in wp_list_categories do anything?
- How can I improve this taxonomy treating approach?
- Sub category templates
- Custom taxonomy template for categories
- How to insert category list into post creation page, and retrieve chosen categories?
- Limit number of posts on a custom category template – breaking pagination
- Categories are not listing their respective products
- Display single category name in woocommerce loop
- Building Menu from Woocommerce Product Categories
- Include WooCommerce product to all child categories
- woocommerce related products by specific categories [closed]
- How can I display the number of post associated to a category in Twig/Timber WordPress? [closed]
- Do not show sub categories in the loop on archive-product.php
- Is it possible to have a template that works on multiple categories where the link address contains the specific category?