here is correct answer if someone need
$aprel = get_queried_object();
///////////////////////////////////////////////////
$aprelpost = array(
'post_type' => 'sikayet',
'post_status'=>'publish',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'sectors',
'field' => 'slug',
'terms' => $aprel->slug,
),
),
'date_query' => array(
'year' => 2021,
'month' => 3
)
);
$aprelpost_query = new WP_Query ( $aprelpost );
$ap = $aprelpost_query ->post_count ;
echo ($ap);
Related Posts:
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Exclude a category from WP_Query
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- query multiple taxonomies
- The Operator “NOT IN” Does Not Work In tax_query
- How to get_queried_object on multiple objects?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Sort the main query in subcategories/terms?
- Help with hierarchical custom taxonomies and permalinks…almost there
- Custom Taxonomy List links being re-written
- custom post type paging not working past page 3
- Want to filter only parent post in admin area
- Custom Taxonomy and tax_query Issue?
- Query current and future events, ordered by begin date
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- WP_Query search posts by custom post type and custom taxonomy
- get_queried_object error How to show post count by month in the taxonomy page
- Fetch taxonomies by custom post type id array
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Genesis filterable portfolio isotope [closed]
- Wrong request query on cpt and tax
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Search / Filter posts on Title/Content OR Tags
- Custom loop with multiple taxonomy queries
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- How to have this permalink structure: post_type/postname/custom_inner_page
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- How to make WP_Query not to show irrelevant posts?
- Create an archive page for custom post type with custom taxonomy
- WP_Query() with custom post type and taxonomy — get all terms?
- Variable not working in WP_Query
- Creating two loops based on different logic
- Wp Query with multiple custom tag(taxonomy) by get the terms
- WP_Query parameter conflict
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- How to show all taxonomies within custom post type loop
- tax_query (if the terms are empty)
- How to count other posts not having specific taxonomy terms?
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Get posts by category name
- Foreach loop returning more than one item when querying taxonomy
- Query custom posts from custom taxonomy
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Related “custom post type” using “custom taxonomy”
- Sorting the Loop by Taxonomy Value
- Ordering by meta value not working
- custom post type and a “sticky” position taxonomy
- get_queried_object not work in taxonomy page
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Live search by custom tag
- WP_Query based on ‘s’ and tax_queries
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- Ajax load more inside custom post type taxonomy
- WP Query tax_query not returning posts
- Create a custom wp_query from a specific custom post type with specific taxonomy
- The most recent post of custom taxonomy
- Problems with the WP_Query query for a Custom post type
- Display all Custom taxonomy terms and their relevant custom posts
- Query pulling all taxonomies, not one I am specifying
- CPT Efficient way to display posts from different categories with custom query
- Get archive of posts separated by taxonomies and subtaxonomies
- Query Pulling the same post twice
- Custom post type and custom taxonomies display
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type
- Custom Taxonomy Query by Taxonomny not working
- Post data in separate divs with incrementing class using WP_Query
- Values inside a custom field to determine which category posts to display
- WP Query WordPress Post Type with the same Taxonomy name
- How to list groupings and keep pagination
- How to save an integer as taxonomy term?
- How to retrieve taxonomy terms of the current custom post?
- Listing all custom post types using a specific term on the said term’s template page, in groups
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Create a list of months based posts
- display custom post type from register taxonomy
- Query custom post type and group by taxonomy
- WP Query – Can’t get posts with specific taxonomy