You can use get_term_children
for checking there is have any child term or not.
$taxonomy = 'custom_tax';
$term = get_queried_object();
if ( count( get_term_children( $term->term_id, $taxonomy ) ) === 0 ) {
echo '<p>HTML only terms without child terms</p>';
}
else
{
echo '<p>HTML only terms with child terms</p>';
}
Related Posts:
- Custom Post Type Permalink / Rewrite not working immediately
- Custom Taxonomy as Dropdown in admin
- Custom Post type in separate database table for syncing
- WP_List_Table Inside Metabox Not Working on Submit
- Creating Photo Gallery System with Custom Post Type
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- has_term or in_category for Custom Post Types
- Custom permalinks
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Custom Permalinks for Custom Post Types and Taxonomies
- how to group custom post type posts by custom taxonomy terms
- Showing current taxonomy terms
- Unable to save custom taxonomy terms in a custom-built metabox
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Custom post type category, taxonomy and URL rewrite problem
- Custom Taxonomy order by Custom Field
- Custom Post Type: How to display all of same taxonomy?
- Is there any performance consideration when using Custom Post Types?
- Show ACF field from custom taxonomy and display on the single template
- Querying Term Posts in Loop
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Permalinks not working for custom taxonomy on custom post type
- Display custom post type in hierarchical order with get_terms
- How to display product subcategories into my custom post type single page
- Am unable to reset a query properly
- Conditional Statement custom post type category
- Custom Post Type permalink shows wrong page: homepage/index.php
- using $wpdb to get custom post type with term
- custom types taxonomy hide_empty
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- How to rewrite url for any specific taxonomy?
- Custom post URL 404 error
- WordPress Doesn’t Generate Taxonomy Archive
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post Type Pagination Paginates Only in URL Structure
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Hierarchial Custom Post Types/Taxonomies
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Rename a slug label
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Migrating Hierarchal Taxonomy Categories Between Post Types
- How to rewrite the post slug of a custom post type post
- Exclude latest post from WP_Query taxonomy term loop
- Getting List of child terms from custom taxonomy parent
- How can I get 3 different taxonomy type terms in a div class element?
- Use different categories for a custom post
- Filter posts by specific custom category and current tag
- Custom Post Type URL doesn’t work anymore
- using custom taxonomies with custom post types: display list of posts by ‘category’
- Custom category URL not displaying posts
- Display featured posts for a custom post type by taxonomy
- What is the most efficient way to execute recursive complex queries?
- How to get post count of specific taxonomy that have store name & category
- WordPress REST API V2: “{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one.”
- Duplicate slug/permalink issue while adding same post name
- display post count in archive page that have relation with another taxonomy term
- PHP Warning with Custom Fields
- Don’t share custom taxonomy terms if applied to multiple Custom Post Types
- How to show custom post count in archive page
- Change CPT permalink to use the category
- How to add independent “Tags” to Custom Post Type?
- Listing all custom posts having a specific taxonomy whatever the terms
- Create a Hierarchical List of Custom Taxonomies AND Posts
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- Shortcode in excerpt
- Previous/Next custom post links within custom taxonomy
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- Custom Taxonomy page redirecting to 404 page
- Pretty permalink structure with multiple (AND OR) taxonomies
- Show custom taxonomy not in submenu
- Custom Taxonomy is disabled on Edit page
- Override “Parent” input for custom taxonomy
- Problem with type plugin and custom taxonomies
- WordPress Custom taxonomy template
- Custom Post Type and Custom Taxonomy not connected
- How to Associate Posts with Pages
- Get link for feed of specific post type AND taxonomy
- Why is this custom post type defaulting to archive.php?
- Get single object term for custom taxonomy
- Sorting custom post types by taxonomy (So close)
- Check if taxonomy is attached to at least one post in a post-type
- Getting (Invalid) when adding custom taxonomy of custom post type link in menu [closed]
- Display custom taxonomy posts of custom post types
- Custom posts and custom taxonomies for many products and categories?
- How to retreive terms associated with a custom post type?
- Return Custom Post Type Categories
- Create taxonomy from Custom Post Type
- Custom Post type as Taxonomy
- ACF Relationship: Group posts by parent category term, then child [closed]
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Url rewrite with custom post type and taxonomy
- Custom taxonomy meta fields
- Custom Sort Order for Custom Post Type Taxonomy
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies
- WP Query – Can’t get posts with specific taxonomy