Here’s how I did it. Just add a conditional that checks if the page being loaded is an admin page or not. If it is an admin page, set hierarchical to false, otherwise set hierarchical to true. Like so:
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'genre'
),
)
if( is_admin() ) {
$args['hierarchical'] = false;
}
register_taxonomy('genre', array('book'), $args);
That should give you the idea. The downside to this is you can’t add parent relationships to terms using the admin interface. You could get more specific in the is_admin()
conditional such as looking to see if the request contains post-new.php
or post.php
…
Related Posts:
- Can’t custom taxonomies have same terms (slugs) as categories?
- Checklist of selected categories
- Using URL parameters, list posts from category and custom taxonomy
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Moving Categories submenu to Media, but still opens Posts menu
- add slug beside name in Admin Category Checklists
- Echo text using is_tag
- When creating a new product, auto assign it to all custom taxonomy woocommerce
- Using heirarchial tags or Custom taxonomies
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- Is There a Difference Between Taxonomies and Categories?
- Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?
- What is the difference between a “tag” and a “category”?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- get_categories for custom post type with a specific custom taxonomy attached
- Order get_terms() By Custom Field
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- Control term order on a per-post basis
- get all tags from category
- How can I add the featured image functionality to a custom taxonomy?
- 404 Error On Category and Tags Pages
- Combine two taxonomies in a hierarchical tree
- Why aren’t sub-categories nested after creating post in the WP Admin?
- Rewrite URL with category and tag combined using WP_Rewrite
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- How can I select a primary category?
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- How to get the url to tag & category base set by the user?
- Filter categories using tags
- How to make custom taxonomy check boxes like ‘Categories’
- Sticky posts on home page, search, tag and archives without plugin
- Different templates for parent and children categories/taxonomies
- cat_is_ancestor_of() for custom taxonomies
- Category and tag with same name
- Create subdomains for tags and categories
- How to create non-unique sub-category slugs?
- In the tag archive – display count of posts for each category they belong to
- Show Post from parent category (custom taxonomy) ONLY!
- Is it possible to disable certain user roles from creating tags?
- Automated adding of one tag to all the posts in a category
- How to convert regular categories to custom taxonomy?
- How to get next previous category in same taxonomy?
- Exclude most recent posts from specific category in wp_query()
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- Why adding Categories does not auto refresh in Backend while using my custom theme?
- How to totally get rid of Category in my blog?
- Root level category, tag, author and archive pages to work
- Showing all the posts in one page?
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Deleting All tags except categories Wp database
- Is it possible to put tags and category information in the post as text?
- Getting WordPress custom taxonomy/category?
- Are Custom Taxonomy Templates Possible?
- Remove “Parent” Selection When Adding/Editing Categories?
- Script to duplicate categories as tags
- Display empty taxonomy terms with get_terms()
- Search by word, category, tag, author
- Get a list of Terms for a specific category
- How to stop wordpress from showing the selected category on top of others in the category selection?
- Order Taxonomy Term by date created
- Remove Categories and Tags from Admin Dashboard
- How to display a description of a given category from a custom taxonomy
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- How to get the number of child categories a specific parent category has?
- display most popular tags of category?
- Render Selected Categories in Admin Edit Post Screen differently
- Get tags specific category
- Can paginate_links() be customized for a specific category or tag?
- How can I convert some categories to a custom taxonomy?
- Any way to assign Post Categories and Tags to Links?
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Category vs Tag vs Table
- Help with multiple dropdown tags search
- Custom WP_Query for current category (in category.php)?
- Category tree is flattened inside admin upon saving
- Hide tag and category boxes from the post editor
- Get multidimensional array that reflects category hierarchy
- Retrieve all posts within tag OR category?
- How to find the number of Tags a post has?
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to not treat categories as tags in feeds
- PHP Fatal error: Cannot use object of type WP_REST_Response as array in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- If statement within PHP echo
- How to know if it’s a child taxonomy?
- Taxonomies for WordPress Media Library [duplicate]
- Categories: A Greenhorn Question on Strategy (Not Code)
- Add Post Screen Keep Category structure
- How can I enable a TINYMCE rich text editor in the admin interface?
- How to customize tag and category post listings to show introductory content?
- wp_dropdown_categories and custom taxonomy + custom post type
- How to change number of items on add new pluggins page from backend?
- Are Category or Tag Archive Pages Possible?
- Specifying multiple categories in URL (permalink)?
- Should the actual /category/ directory be 404? Is that normal WP behaviour
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- How can I duplicate categories and tags?