Maybe better to use wp_list_catergories.. codex: wp list categories
$args = array(
'taxonomy' => 'type',
'orderby' => 'name',
'show_count' => false,
'pad_counts' => false,
'hierarchical' => true,
'title_li' => ''
);
<ul>
<?php wp_list_categories( $args ); ?>
</ul>
and add to css:
.current-cat{
background-color: #d86f08;
}
Related Posts:
- How to add a body class based on a custom taxonomy term
- Changing stylesheet depending on custom taxonomy terms
- Styling Taxonomy Terms Individually
- Add A CSS Class To A Menu Item When A Custom Taxonomy Term is Present On Single Post
- Body class to each level of a hierarchical custom taxonomy
- How to add meta fields to custom taxonomy add/edit page?
- How to add/enqueue Custom CSS for a custom taxonomy page?
- How to modify a taxonomy that’s already registered
- Change order of Custom Taxonomy List
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- How To Change Custom Taxonomy To Radio Buttons
- RSS Feed for posts containing any term from a taxonomy
- Front End Post Save Child terms
- Page queried instead of a custom taxonomy
- Pros and cons of using [taxonomy name] in place of [category name]?
- Custom Taxonomy terms with latest post ordered by date pagination issue
- drop-down list another query
- Echo taxonomy term meta on author.php
- Custom taxonomy template not working
- custom taxonomy archive permalink shows 404 error
- is there any limit of length on creating custom taxonomies?
- List only first-level children of specific custom taxonomy term
- Sorting Posts Via Custom Taxonomy Values Using Checkboxes?
- get_terms of post->id
- WordPress renames slug of tags used in multiple taxonomies?
- How to get a list of taxonomy terms which are being used only within certain post types?
- Taxonomies: display hierarchical parent list
- how to search in custom fields & custom taxonomy for custom search
- List Custom Taxonomy Based on Post Count & Category
- Custom taxonomies as product variations
- Display an image instead of tag name?
- Echo specific term in an array
- Is it possible to get all term items from a custom taxonomy regardless of post attachment status?
- Permalinks for custom taxonomy stopped to work
- ‘Show on screen’ for custom taxonomies does not save
- Displaying terms by first letter
- Filter WooCommerce admin products list by a custom taxonomy
- Get custom category image from menu
- get_category_link returning page URL
- Getting values of a custom taxonomy dropdown
- Show preset taxonomy description
- What is faster: custom taxonomy or serialized post-meta for db retrieval? (over 60,000 posts)
- Get taxonomy based on another taxonomy slug
- How do I modify taxonomy term slugs dynamically?
- Getting associated taxonomies
- Can’t set custom taxonomy terms via custom form
- Custom taxonomy not appearing in menu administration panel
- how can i display taxonomy instead of category on my web page?
- Taxonomy Meta Box in User Profile?
- What does ‘category__in’ mean in queries?
- When filtering query on custom taxonomy; main menu dissapears
- How can I make front page to display custom taxonomy page?
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- Why doesnt this query work? (Custom Taxonomy)
- How to group all terms children’s in custom taxonomy?
- Display Posts by Custom Taxonomy Chosen Terms
- How do I get term data associated with the current post, where the result is not wrapped in HTML?
- Custom taxonomies mixed into categories and tags in Post edit page
- How to show post list based on taxonomy term?
- WordPress autocomplete search with taxonomies
- Display empty custom taxonomies differently than with one with posts
- How to list Custom Taxonomy
- remove term from custom taxonomy list
- Display taxonomy with a maximum number of letters
- Taxonomy archive template not working
- Dropdown list of taxonomies won’t display selected
- Display Child Categories of Current Post ID
- Taxonomies specific to Page attribute template
- custom taxonomies on pages
- Set two terms for a post when they differ only by an accent
- Unknown column ‘wp_posts.ID’ in ‘field list
- Custom taxonomies registered via plugin stop existing after function finishes running
- Echo ACF taxonomy field within a foreach for another taxonomy
- Keeping session instance of random display results over pagination breaks
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- How can I rewrite the URL of my custom taxonomy to include the year?
- Infinite Scroll appending Next Product Category Term pages
- Listing Cities A custom taxonmy by selection order
- Count tags for current post and save into custom meta field (and update it on post edit)
- Problem registering custom taxonomy
- Limit Tag Links in Post Content
- Passing taxonomy id of taxonomy clicked on one page to another page
- Custom Taxonomy Not Being Recognized by is_tax()
- How to truncate the description in the admin panel for a custom taxonomy
- Get all users attached to a taxonomy
- Permalinks incorrectly inserting multiple categories
- How do you move custom fields to custom taxonomies using WP Queries
- Why is it defaulting to “uncategorized” even after I select a custom taxonomy
- Where to put code to get custom taxonomy term id?
- Get one custom taxonomy category
- Select default taxonomy on dropdown
- Creating a page for custom taxonomy archive
- WordPress Taxonomy Menu
- Insert code on specific taxonomy archives
- How can I query for all values of a custom taxonomies?
- Returning info from MYSQL table via custom taxonomy
- get_term_children specific no id
- custom texonomy category child category list with parent head
- Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms
- Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy