You can use wp_get_post_terms()
which will return all the terms attached to the post, if any. Then, the first term of the array will be able to tell you which taxonomy it belongs to:
global $post;
$terms = wp_get_post_terms( $post->ID, array( 'regions', 'sections' ) );
if( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$taxonomy = $terms[0]->taxonomy;
}
I do not know what your taxonomy slugs are so I guess, you may need to change them to fit your specific setup.
Related Posts:
- How to prevent new terms being added to a custom taxonomy?
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Get value in custom field with taxonomy [closed]
- Get second level terms of custom taxonomy
- Taxonomy menu with post count and multiple parents
- Sort Custom Post Type Archive by Taxonomy Term [duplicate]
- Modify Term Update Redirection
- How to get first post in a category of a custom taxonomy
- How to get the singular name of a custom taxonomy?
- Archive template for taxonomy terms
- pre_get_posts OR relation between taxonomy and author
- Custom Fields and performance
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- Dynamic page slug for Custom Taxonomies?
- show term description instead of list terms of custom taxonomy
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- get_the_term_list without specific category
- Add Category Name to REST API
- Last posts from custom taxonomy
- How to add a body class based on a custom taxonomy term
- User role permissions based on taxonomies
- Search by type posts and taxonomy
- get_the_terms() to show all custom taxonomies
- Get Taxonmy Term ID For Current Post
- Is it possible to create exclusive custom taxonomy?
- Custom Taxonomy Archive BUG
- Can I limit term selection to one plus parent?
- how does get_term_by know which term to return when the same term appears twice in a hierarchical taxonomy?
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy with_front causes all
- Why is my taxonomy template not shown?
- cannot get multiple loops using tax_query
- How Can I Change a Taxonomy URL Based On The Originating URL?
- How To Assign “Taxonomy per Taxonomy”?
- How to add a Rewrite Rule / Category Structure
- Hide posts having children terms when display posts by category in edit.php
- How to have two different versions of a tag/category/taxonomy archive page?
- Custom Taxonomy Term Caching?
- Controlling Taxonomy Category listings to hide and unhide specifics
- Rewrite Rule Working for all but one of the taxonomies created
- Get custom taxonomy for visual composer shortcode but not working?
- woocommerce custom product category template
- Custom taxonomy multiples
- Is there a template file to list all terms of a given custom taxonomy?
- List of users inside custom taxonomy
- Rewrite Rules returning wrong data
- Multi-select field for Taxonomy can’t save the value
- How to Display a menu only if it has Posts in Custom Menu?
- how does the wordpress rest API work
- Taxonomy terms can still be added when only assign_terms capability has been granted
- Use an HTML Element To Filter Taxonomies In WP Search
- Why is flush_rewrite_rules mandatory after registering custom taxonomies?
- tax_query not working
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- wp_query not resetting, last post hanging
- Set term on an attachment using wp_set_object_terms and want to display the full term text but it’s showing a slug instead
- custom taxonomy not showing in Gutenberg
- Can I add other Custom Taxonomy to my syntax (functions.php)
- how to get term id from current post type instead of name
- Display children category images
- Dropdown taxonomy lists in admin menu
- Is there a way to change select-list for new custom taxonomy?
- How to define %category% for custom taxonomies?
- How to list terms by first letter, as in A’s then B’s etc
- How to Create Multi selection search Form using Default WordPress Category Terms, and Custom post Types Taxonomies Terms?
- Taxonomy hide not working
- How do I get the correct URL?
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Query all images with certain tag in media library using visual portfolio plugin
- See double taxonomy inputs in WP editor
- How to change custom categories term links?
- Body class to each level of a hierarchical custom taxonomy
- Problem with wp_list_category with custom taxomy
- Restructuring permalink with more than one taxonomies
- Restrict viewing of posts by category, user role
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- ajax drop down change second drop down data
- Redirect or Prevent Viewing of Custom Taxonomy’s Archives?
- Does a codex exist for creating meta boxes in taxonomy
- Display taxonomy term slugs
- Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?
- Run next query based on first query’s term
- Get the original menu item name string instead of the label
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Tax query array terms display out of order
- How to change taxonomy slug?
- Taxonomy to WordPress Permalinks of custom post type
- How to query posts that are not related to any term of a taxonomy?
- Function code problem
- Permalinks not working on MU network with domain mapping
- Create WordPress taxonomies based on theme settings
- add_action with variable as a part of the $tag string
- Get custom taxonomy term url on archive page
- I’ve got a function that auto creates taxonomy terms – Can it auto delete them as well?
- Get custom taxonomy value of post and output posts in same taxonomy
- add_rewrite_rule pagination 404 error on page 4 and above
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post