is_tax()
returns true on a taxonomy archive page, it has nothing to do with whether terms exist in a taxonomy.
you just need to add a check for anything returned from wp_list_categories
before outputting any markup:
<?php
$args_list = array(
'taxonomy' => 'productcategory',
'title_li' => __(''),
'show_count' => false,
'hierarchical' => true,
'echo' => '0',
);
$product_categories = wp_list_categories( $args_list );
if( $product_categories ):
?>
<div id="shop_by_cat">
<ul>
<?php echo $product_categories; ?>
</ul>
</div>
<?php
endif;
?>
Related Posts:
- Manipulating cookie on specific taxonomy archive page
- get / list categories and counts filtered by custom taxonomy term
- “show option all” on list categories doesn’t display taxonomy
- display taxonomy slug from term ID
- Using wp_list_categories to show more than one custom taxonomy
- Display Taxonomy Terms in an option tag with value being the slug
- Category list with indent children list below current category
- Widget dropdown always displays first option
- What does ‘category__in’ mean in queries?
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Echo text using is_tag
- Limit Display Number Of Taxonomy Term
- Variable Not Working Inside is_author() Array
- Show single Child Category on Custom Post
- Get 1st parent category id from post
- Conditional if is single and part of the custom taxonomy
- How to show category list in WordPress
- List all taxonomies with their descriptions
- Problem with wp_list_category with custom taxomy
- ACF Custom field not showing in Timber Taxonomy page
- Add and Custom category for posts “PAGE”
- Best Method to Switch Between Terms (Custom Taxonomy)
- Custom taxonomy list in Worpdress
- Displaying Custom Taxonomy List Posts By Slug?
- custom texonomy category child category list with parent head
- How do I get the top-level terms in a custom taxonomy?
- Which template name to use for taxonomies but not their terms?
- Count number of post in Taxonomy?
- Fix : Custom Taxonomy Duplicating in each call
- Taxonomy list. Order by a specific custom post type count
- Create Admin Only Taxonomies?
- Category page and edit post page with this category very slow
- Custom taxonomies
- Custom/separate categories for custom post type
- Add parent/child taxonomy to custom post type url
- Extending wordpress search to include excerpts and taxonomies?
- Adding ‘active’ class to custom taxonomies using walker in functions.php
- How to output content based on same custom taxonomy?
- How to create custom taxonomy URLs without taxonomy name?
- How to add taxonomy to Users menu in admin?
- Show nav link highlighted
- How to create new category for custom post type?
- How can i retrieve all custom registered taxonomy?
- How to Put Custom Taxanomy Meta Box in Main Column
- How to add taxonomy to user?
- How to use get_the_terms() to display multiple terms?
- Woocommerce product search result layout page
- Sorting Tags by Slug Value
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- List posts of term on term’s admin edit page
- Taxonomy Order by Name
- Change the permalink URL to include a taxonomy term
- How to limit the number of users who can be added to a user custom taxonomy?
- Get Custom Taxonomy Title by Spesific Sub Category via fputcsv
- Taxonomy Pagination Rewrite
- taxonomy tax-name archive
- Set Custom Taxonomy to Entire Site Programatically
- List of Posts and Categories
- Same term from custom taxonomy in two different custom post types?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- Inserting HTML to close and open divs in WP_Query loops
- 2 custom post-type and 1 taxonomy
- Order get_terms() by hierarchy
- Forcing a term/taxonomy on all posts of CPT
- Displaying Custom Taxonomy without a hyperlink
- Is it safe to register a taxonomy without using any hooks?
- get_the_tags Conditional display of a custom taxonomy
- Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post
- How can I change the output display of my pagination?
- Hide custom Woocommerce taxonomies when empty
- Custom permalink accept any params
- Terms change id after importing
- I need to exclude from a query a category and a few custom taxonomies
- Get current page term title to use in WP_Query
- If custom taxonomy else conditional [closed]
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Custom Fields Value As Taxonomy
- Using Custom Taxonomies to organise products – struggling to call a correct list
- Use wp_list_categories to list parent categories from actual term
- is there a way of getting term children that only shows those from two taxonomies
- Get Posts Related to Category By category id or slug
- How to display custom taxonomy term specific post?
- How to add a dynamic dropdown derived from custom taxonomy
- Order get_terms by count using a custom taxonomy hierarchy
- How to add chained dropdown filter to a wordpress website
- custom taxonomy not showing up after adding capabilities upon updating to WP 5.1.1
- transfer two existing taxonomy terms into one custom metabox
- Change the Page Title of the Archive Page for Portfolio Tags
- Dynamically creating content on custom URL without getting 404
- Creating a Taxonomy Page [duplicate]
- WordPress shortcode Issue!
- Switching from catalog to product category/subcategory
- Extra fields on categories that is available via the WP-API?
- Tax Query not working
- Taxonomy archive page have no post
- Display list of custom taxonomies from a custom post type ordered by their parent
- how to import custom taxonomy (& terms)
- How to create a page that lists custom taxonomies with links?
- Getting taxonomies specific to categories
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post