You can wrap it in the same check used for $category:
<?php if (isset($term->term_id)) {
echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>';
} ?>
or check to make sure it is not an error object:
<?php if (!is_wp_error($term)) {
echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>';
} ?>
Related Posts:
- How to get WooCommerce Product Category Link by ID?
- Approach for saving a product attribute values with a custom UI in a woocommerce+dokan set up [closed]
- Set download limit and expiry for WooCommerce downloadable products in specific categories
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Woocommerce custom taxonomies page
- Outputting an array of term meta values in a custom WooCommerce tab?
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- Get child product categories from parent product category in WooCommerce
- Top level parent taxonomy ID
- Woocommerce product search result layout page
- Filter WooCommerce admin products list by a custom taxonomy
- Woocommerce: How to change the add to cart text in a certain category? [closed]
- Get custom category image from menu
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- Hide product categories and taxonomy terms in menu if empty
- Display related products based on 2 specific product attributes values in WooCommerce
- How to target parent product category and its children using WooCommerce?
- woocommerce custom product category template
- Getting WooCommerce product related child categories
- Hiding taxonomies with no children WP_Query & tax_query
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- Hide custom Woocommerce taxonomies when empty
- Add attribute taxonomy through code don’t appear in admin product page
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Showing custom taxonomy in woocommerce signle product page
- Adding term to a custom taxonomy based on term from product category
- Warning: Undefined variable $post in C:\xampp\htdocs\… after PHP upgrade
- Admin only taxonomies?
- Fill New Taxonomies
- Infinite Scroll appending Next Product Category Term pages
- How to exclude woocommerece product category in search results?
- Cloning product not copying custom taxonomies
- Check if any available product has specific attribute
- how to show product custom taxonomies in woocommerce rest api
- WordPress search form and search result through ACF field in custom taxonomy
- Get user created Woocommerce attributes ( taxonomies ) [closed]
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- How do you search for a post by custom taxonomy?
- Display woocommerce product_cat child terms with thumbnails
- Woocommerce – how to get and display selected variations on single product page
- How do I check if a post has a term with a particular ancestor/parent?
- Creating a custom archive page for WooCommerce products based on tags
- Hide empty categories on widget
- Change filter id into slug
- Set Variant options/attributes values on WooCommerce
- Get the the top-level parent of a custom taxonomy term
- get_terms – only top level
- Order get_terms using a Custom Field
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- wp_options table value
- Custom Taxonomy Meta Admin Column
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- How to assign default taxonomy to pages on ‘save_post’?
- wp_query orderby title and meta key value (WP3.1)
- custom taxonomies on permalink
- Manipulating cookie on specific taxonomy archive page
- Landing in 404 Page on Navigating to Custom Taxonomy Archive
- Get main term from a sub term in Woocommerce
- Category page and edit post page with this category very slow
- Custom Taxonomy tree view not showing correctly in backend
- Generic taxonomy-term template page
- How to add taxonomy to Users menu in admin?
- Category page for custom-taxonomy shows 404 when using custom permalink structure
- How to count the number of terms in a taxonomy
- Current category link filter
- How to Put Custom Taxanomy Meta Box in Main Column
- Hook to change Custom Tag Taxonomy Links?
- Sorting Tags by Slug Value
- Posts in loop displaying all taxonomies
- Custom Taxonomy in REST API
- how to change permalinks format for pagination?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- Some custom taxonomy child terms not showing in admin. Caching problem?
- My custom taxonomy page is leading in 404 page
- Different Taxonomy Values for Each Post
- List Top 5 taxonomy terms based on number of post
- Get list of taxonomies associated with users
- check if a taxnomy queried in $wp_query?
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Items from media library won’t get added to a custom taxonomy
- Custom field with terms from another taxonomy programmatically
- Taxonomies and subtaxonomies relations
- Retrieve & Display User Meta Values from Checkboxes
- Custom taxonomy if statement
- How do I check to see if a specific child term has shared posts with another set of child terms within the same taxonomy?
- Group & Sort Taxonomy terms by letter – Is there a better way?
- Custom Taxonomy Archive Page for Parents AND Children?
- Multiple taxonomies, what should the permalink look like?
- Child Pages and Custom Taxonomies
- Determine if Term has Grandparent/Great-Grandparent
- Sorting Custom Taxonomy in ASC/DESC order?
- Saving Taxonomies to Post Revisions
- Error when adding custom taxonomy to wp nav menu
- How much worse is querying custom fields compared to custom taxonomies, quantitatively
- Prevent random entries in hierarchical false taxonomies
- Exporting CSV of users with custom user taxonomies out of WordPress
- Pagination links not working for custom taxonomy
- Sub-pages of Custom Taxonomies
- How to delete unused terms?