Since get_term_link()
will return a WP_Error
object if the term does not exist, you could try:
$termchildren = get_term_children( $taxID, $taxType );
echo '<ul>';
foreach ( $termchildren as $child ) {
$term = get_term_by( 'id', $child, $taxType );
$term_link = get_term_link( $term->name, $taxType );
if( ! is_wp_error( $term_link ) )
echo '<li><a href="' . $term_link . '">' . $term->name . '</a></li>';
}
echo '</ul>';
so it looks like you are trying to echo the WP_Error object.
You could try to debug it with:
if( is_wp_error( $term_link ) )
echo $term_link->get_error_message();
Related Posts:
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- How to create drop down for child categories of current taxonomy being viewed?
- How to show all possible parents and children of a hierarchical taxonomy term?
- Sort order by slug for looped child terms of custom taxonomy
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- Display children category images
- Display Child Categories of Current Post ID
- How to include child terms within parent?
- Get the the top-level parent of a custom taxonomy term
- get_terms – only top level
- How to only list the child terms of a taxonomy and not their parents?
- Hierarchical taxonomy UI
- Order get_terms using a Custom Field
- Is there a way to ‘Lock’ a Taxonomy?
- Hide the term description on the term edit page, for a given taxonomy
- get_term_by not working when in functions.php
- Can I lock down custom taxonomies on a parent term level, but not a child term?
- Get only the first term by taxonomy
- Exclude specific slug in ‘get_terms’
- Return only the custom sub-term for custom post type, do not echo term-parent
- wp_insert_term is adding a term that has no name
- get_terms() returns an empty array
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- WP_insert_term how to insert multiple values as taxonomny term?
- Group posts that matches a term in a loop
- Custom taxonomy term as class?
- How to edit/remove a term that’s in multiple taxonomies?
- How to display term description in empty terms archive?
- Checking if a Page has an Associated Term?
- get_terms custom order
- Limits amount of terms displayed? Is it possible?
- how to create a proper query for getting a list of users with taxonomy related meta key
- How to List Parent Term Links for Custom Taxonomy With & Without Children?
- Generic taxonomy-term template page
- Get direct children of custom taxonomy
- List subcategory on taxonomy term page
- Operations with custom fields values in a loop
- Check if term is in a taxonomy?
- Get child product categories from parent product category in WooCommerce
- Set custom post type terms by id without knowing taxonomy
- How to determine the depth of a term in a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy
- Display the description of taxonomy terms
- get_terms adds slaces to the resualt
- Term count by user
- get_term and get_term_by return null or false, even though term exists
- Display Taxonomy Terms in an option tag with value being the slug
- How to add contents of a custom field to a taxonomy term list?
- one term two taxonomy’s?
- Getting WooCommerce product related child categories
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- Query posts from a child taxonomy term id
- get_terms() duplicate first term of a custom taxonomy
- Having Issue on Passing Variable into HTML Class Tag
- How to customize taxonomy archive template files for subterms?
- Echo custom taxonomy slug
- Admin (All posts) stop responding problem
- Query posts using custom taxonomy and selected terms
- Proper use of wp_get_object_terms
- Remove a href from this code
- Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post
- one post per term taxonomy
- How to check if a post has at least 2 terms from a custom taxonomy attached?
- How can I change the output display of my pagination?
- Can’t get taxonomy ID for each post on archive page
- Get name of taxonomies of current page
- Terms change id after importing
- delete term from taxonomy and assign in new one
- How to add a date creation field when a custom taxonomy relationship is created?
- Adding Child Terms Programatically – No Warning but No dice either
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Running a function only once when a taxonomy term is changed
- Set post terms by term id
- Displaying my custom taxonomies in a using the_term_list()
- Use wp_list_categories to list parent categories from actual term
- Trash Bin for Categories?
- using wp_insert_term to create custom terms for a custom taxonomy from frontend form,
- is there a way of getting term children that only shows those from two taxonomies
- Display term picture of each post in a loop
- Get Terms of custom Taxonomy of products with certain Product Category
- Problems using get_the_terms in a plugin
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Tree view wp-admin terms
- Retrieve the child terms by having the parent’s information
- add pagination in wordpress page template
- Order get_terms by count using a custom taxonomy hierarchy
- How to create a non removable taxonomy term?
- WordPress taxonomy terms archive template help
- Show message if term slug changed
- generate random slug when adding taxonomy
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- qtranslate-x problem with custom term description
- Custom post type term names with ampersand in the term name
- Sorting terms individually for each post
- get_terms returns array starting at 4
- Multiple category lists on one page
- get_the_terms inside save_post gives old terms
- Hide empty categories on widget