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
- How can I get the categories and subcategories separately?
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Control term order on a per-post basis
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- How to list all categories and tags in a page?
- wp_update_nav_menu_item() to insert categories
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- Create terms when registering taxonomy?
- cat_is_ancestor_of() for custom taxonomies
- Display only deepest category on a single post?
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- Wrap a chosen category name with div
- How do I get the slug of a custom taxonomy category of a post?
- How to display a description of a given category from a custom taxonomy
- How to query posts from specific authors and categories using WP_query?
- Show Post Count of a Category
- Add custom taxonomy under the category title
- Category tree is flattened inside admin upon saving
- “show option all” on list categories doesn’t display taxonomy
- List Terms in Category
- How to get category URL with the slug?
- Display all posts in main category and 1 subcategory
- Display Slug instead of Name
- ACF: Display category name using taxonomy field
- Categories of custom taxonomy don’t show any posts
- Taxonomy name repeating when showing 2 posts from each category
- New Categories Not Shown In the Post Edit Page
- Shortcodes not working in category or tag description
- Display Posts Loop for each parent and for each Child
- Get Number of total Parent Categories for Custom Taxonomy
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- Limit categories and it’s subcategories for specific group of users
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- add slug beside name in Admin Category Checklists
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Display sibling categories on category page
- Having a template per category? Bad for server overhead?
- WP 4.7 in_category change?
- Get posts of a custom post type from category from taxonomy?
- Illegal string offset ‘taxonomy’ in
- Change categories count to include media attachments
- How to get selected taxonomy or category ID if using custom walker?
- Let user select their own category
- Category link redirect to custom template page instead of index.php?
- 3.1 post formats and specific categories/custom taxonomies
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Show subChild categories
- How to show related posts of category on post within custom posttype
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- Automatically add custom taxonomy to posts in a category
- Ordering terms whilst in loop
- WordPress Portofolio Conditional Templating – functions php
- ACF Custom field not showing in Timber Taxonomy page
- Confused about category.php template – not working
- Display Taxonomies in loop with template args
- How to add additional field to Add new category part (without plugin use) [closed]
- Category and tags goes 404
- Display only the latest post
- list taxonomy based on taxonomy
- get IDs from links categories
- Multiple Parent Category URLs
- Taxonomy term RestApi data 10 rows limitions
- Add custom fields to Woocommerce Category Page
- How to make /category/ URL load properly instead of 404 error?
- How to get parent and child sub category (Taxonomy) order to display