Try using get_queried_object():
$term = get_queried_object();
echo $term->name;
If you get nothing there, try this:
print_r($wp_query);
Everything you need is in the $wp_query global.
Hope this helps you.
Related Posts:
- 3 random images from custom post type, each in a div with a diffrent class
- what is the correct way to compare dates in a WP query_posts meta_query
- How to get post content by calling ajax?
- How to disable generation of default image sizes for some custom post types?
- How to show all posts of the category in wordpress?
- Display a query with multiple post types and same relationship on a single page
- How to filter custom posts by tags and custom fields?
- Order by & include array by specific post ids
- How to remove “featured image” functionality from a custom post type?
- How to call a custom post with get_posts() instead of query_posts()?
- Querying custom posts and regular posts
- Retrieving 3 latest post from each of 5 different custom post types
- How to hook get_terms() to only show count of posts that have custom meta
- Using Offset in Custom Post Type Query
- how to group custom post type posts by custom taxonomy terms
- Using Query Posts With Multiple Post Types And A Taxonomy
- Query posts by custom post type and custom taxonomy
- Query post types with multiple keys
- Featured image metabox not showing up
- How to use different featured image size for a custom post type?
- pre get posts changing the query
- Get permalink and title by post name?
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Get all posts WHERE custom_field is LIKE value
- Quickest way to get last or oldest post date – WP Query
- ‘category__and’ for custom taxonomy?
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- query_posts with a custom post type, a meta_query and sorting by post date?
- Combine query_posts() and get_posts() into single query
- how can i get posts from custom post type particular taxonomy category
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- Sort by custom field is not working
- Using global $post; to get featured image for custom post via WP_Query
- Displaying media for custom post type
- Sorting multiple custom post types without a meta key/value pair by sort order
- Custom post types instead of regular post’s categories in a page template
- Change or update WordPress loop based on dropdown selection
- How to change post featured image using a custom field of category?
- Change Featured Image / Thumbnail CMS Description
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Display custom post type from dynamic custom field
- Is it possible to show full content of the post when there is only one post in a grid?
- Display only one post each WEEK
- List children on child post
- Get posts between custom dates
- Link to full size post thumbnail
- Page template with different page and post content
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- unable to show custom post type featured image
- Limit the post for differents custom post type in the same wp_query
- BBPress Search results in WordPress search
- pagination not working for category.php (custom post types in categories)
- how to post default thumbnail if post not created yet
- Filter date from post meta when date is in string format
- Post-thumbnail only for specific post-types?
- Featured image size in column
- Custom query – get_the_terms not work
- Control content before and after custom post type loop
- Display custom posts randomly in custom taxonomy archive
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- why is the current page title being output?
- Count custom post type based on two meta data
- Not able to export large no. of posts in csv
- attach CPT data to a taxonomy
- Targeting custom post type via functions.php doesn’t work
- Dynamic pages for linked categories and content
- Dynamic category name in query post
- Cannot upload featured image to a custom post type
- Custom Post type showing up in loop, regular posts are not showing up
- Add Permalink to Post Thumbnail, syntax code issues
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Query for bbPress replies to current topic?
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Custom wp-query display post only today
- Filling custom post type posts from a rest api
- custom post type and a “sticky” position taxonomy
- Trying to list years (for a filter) but not all years display
- Modify default Related Posts Code to Custom Post Type
- update a posts of other custom post type
- Imported Content Doesnt Show Up On Frontend
- How To Loop Through list with Custom Post Types
- Optimise custom post type queries
- How to get Last post Id of custom post type in wordpress
- display news with pictures 3 small and one large (loop)
- Filter RSS feed for custom post type to events for next 7 days only
- Using $seed on a custom post type for randomly displayed posts
- Custom post type blog pagination conflict
- What’s the best way to show custom post types? With page template it’s not perfect!
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Query custom type posts by array of IDs
- Trying to set up a range filter for related custom post types
- Delete old thumbnail when updating new
- Display ACF object field data using Elementor Custom Query
- set_post_thumbnail or media_sideload_image adds image multiple times in media library