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]
- Display All Products by Category with 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
- Create product category and keyword search form in woocommerce? [closed]
- Display only deepest category on a single post?
- 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?
- Display WooCommerce product categories in a 4 columns custom menu [closed]
- Hide uncategorized products from the shop page
- is_archive() content being shown instead of is_category()
- How to control template resolution if both Author and Category filter in place?
- Which php file lists all the post of a category
- Apply custom category template to subcategories
- Display “add to cart” button on every listing in product category page?
- Code to pull in a PHP file named after the category ID
- Get woocommerce catogry
- Are Category or Tag Archive Pages Possible?
- Possible to make a subdirectory that loops through a single category?
- Woocommerce category show subcategories only/omit posts for specific category
- products nested by subcategories in a current category archive
- WC 3.x Get categories from variable product of the cart
- 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
- Different templates for different category tags
- Pagination not visible on woocommerce’s category page
- Best way of getting WooCommerce category path
- 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?
- Change thumbnail image depending product category
- Unwanted Duplicate Product Categories in WooCommerce
- Woocommerce custom category pages
- Customize WordPress widget – Product Category
- Does “show_option_all” in wp_list_categories do anything?
- How to insert category list into post creation page, and retrieve chosen categories?
- 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]
- List just subcategory and products of active category page in Woocommerce
- Display all product tags associated with a specific product category
- Adding custom ID field to the categories
- How to display product with two condition, category and brand taxonomy
- Using if statement in index.php instead of creating separate template files
- Displaying year once in category.php [duplicate]
- How to differentiate the homepage structure from the category page structure in WordPress template?
- How can I include custom category and tag base in template files?
- Include home page template in specific category template
- Showing different posts on category pages
- displaying the last product comment in the woocommerce category
- Woocommerce only display child category when parent is checked (on add new product page)
- category description not showing in my woocommerce
- Show audio player only in specific post type category
- How to make product image inherit from category image
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- In if…else condition, the else statement shows even if if statement is correct
- How can I display all products from all categories on one page with woocommerce?
- How to add all subcategories as submenu in WordPress menu
- How to edit woocommerce sub-category page
- in post content shortcode works, but hardcoded in same page template doesn’t?
- selecting categories that have products with tag/category
- Restrict retrieved terms by category?
- How to fix 404 error in pagination in categories of woocommerce with common url base /shop/?
- Custom Archive Template for Multiple Categories
- Woocommerce Category Sort Dropdown
- Woocommerce: all products of all categories instead products of one category
- How to delete WooCommerce categories in bulk that only have one product
- Product Category page showing all products
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- How to get WooCommerce Product Categories and its children’s children?
- Category custom template is not showing correct posts
- Woocommerce change tag_id to name
- Choosing different templates for categories
- Show posts from all categories
- Most efficient way to have 1 template for parent, 1 template for child categories?
- Category menu that filters out empty categories
- Category Templates for Post Types not Working
- One category not displaying template updates
- How do I get a single page navigation depending on the previous page?
- Add 1 category more to If_in_category statement
- Custom Woocommerce Category view
- Category Template – to be editable from the backend?
- Displaying categories and subcategories without link
- have_posts is empty on category.php
- How to create a template for categories
- WooCommerce category display in custom page
- Sorting Woocommerce products by category and attributes
- Woocommerce custom taxonomy order
- Update wordpress menu with woocommerce products
- How to get Woocomerce categories count
- Get all categories
- Categories and products woocommerce wordpress
- Restricted category in Woocommerce [closed]