I fixed it by using the following code:
$current_term = $wp_query->get_queried_object();
$termid = $current_term->term_id;
Works quite well
Related Posts:
- get_categories for custom post type with a specific custom taxonomy attached
- How can I add the featured image functionality to a custom taxonomy?
- Combine two taxonomies in a hierarchical tree
- How can I select a primary category?
- How to make custom taxonomy check boxes like ‘Categories’
- How to create non-unique sub-category slugs?
- How to get next previous category in same taxonomy?
- Getting WordPress custom taxonomy/category?
- Display empty taxonomy terms with get_terms()
- How to get the number of child categories a specific parent category has?
- How can I convert some categories to a custom taxonomy?
- Get multidimensional array that reflects category hierarchy
- Change existing taxonomy settings when using custom taxonomy
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Display custom taxonomy attached to the post on post single page
- Question on using custom structures for categories
- Echo text using is_tag
- Same menu for different taxonomies to reach different content
- How could I write a get_categories_by_year() function?
- How to get posts using category slug in ClassiPress?
- How to set the same base url for two different taxonomies?
- Get WooCommerce product category list in functions.php
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- How to Manage and link certain custom taxonomy?
- Display List of Categories Within a Custom Taxonomy
- How to add a post with new Taxonomy without assigning to default category?
- Converting Categories (with ACF fields) to custom taxonomies
- Get Posts Under Custom Taxonomy
- Control term order on a per-post basis
- Can a Child Category Have More than One Parent?
- Create terms when registering taxonomy?
- How to convert regular categories to custom taxonomy?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- wp_list_categories, Add class to all list items with children
- Return category slug / title from category ID
- Connecting WordPress gallery to custom categories (taxonomy)
- Get term by slug in Gutenberg
- How to get the depth of a category’s subcategories
- New categories are now going to 404s
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- If statement within PHP echo
- Taxonomies for WordPress Media Library [duplicate]
- How to create new category for custom post type?
- display taxonomy slug from term ID
- Taxonomy filter all children
- Force a user’s posts category
- Search Posts / Pages with multiple options?
- How to filter out Categories for specific post types on WordPress Admin?
- How can i insert term in a specific language of Polylang?
- How to organize custom categories for filtering and selecting
- Custom sub taxonomy order by
- Is There a Difference Between Taxonomies and Categories?
- Get all media categories
- Custom taxonomy/category order
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Targeting Parent Category Pages
- get_terms function not returning anything
- Why custom taxomony not showing when create a post?
- Include WooCommerce product to all child categories
- Notice: Trying to get property of non-object in : custom fields category
- WP REST API not retrieving all categories
- Eliminate word from $term->name
- What Must to Display the “mysite.com/category” URL?
- Custom page category taxonomy 404
- How to get posts by category and by choosing a taxonomy term?
- Is it possible to create an alias/custom taxonomy for a category name?
- Style a category from category list
- Showing HTML if Post is In Certain Taxonomy Term
- I need to exclude from a query a category and a few custom taxonomies
- Assign a custom post to a custom taxonomy based on custom field value
- Custom Fields Value As Taxonomy
- get_the_category – display only a single category for a post (not all categories)
- get_the_terms has strange result since version 6.0
- display category with background color
- Disable Category Taxonomy
- Page category filter in admin dashboard
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- How can i echo next and previous custom category from a Taxonomy
- How to show category list in WordPress
- get taxonomy list in a page in the wordpress
- Number of categories slowing down the site
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- Using heirarchial tags or Custom taxonomies
- How to echo Tags and Categories as plain text
- How can I add HTML classes for current taxonomy/term hierarchy into my pages to simplify styles?
- Dynamically creating content on custom URL without getting 404
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- List Terms by category
- Taxonomy for custom post type not found
- Why is my post categories not displaying?
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- Images as Categories
- Taxonomy page wpml dropdown not working
- Is it possible for post and custom post type to share a category base slug?
- Quick Edit on taxonomy names results in error