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
- Display all posts in a custom post type, grouped by a custom taxonomy
- Exclude a category from WP_Query
- WP_Query() show posts that end later than today
- $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
- Custom Taxonomy with Custom Post Type Finds No Posts
- The Operator “NOT IN” Does Not Work In tax_query
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- Custom query – alternate posts by category
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- How to get_queried_object on multiple objects?
- how to group custom post type posts by custom taxonomy terms
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- wp_query check if integer exists in custom field’s array
- 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-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Post count by month of taxonmy term
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Custom taxonomies relationship
- How to have this permalink structure: post_type/postname/custom_inner_page
- Query Custom Post Type Taxonomy term with multiple parameters
- First custom field value (out of several) displayed twice after query
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_query
- 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
- Retrieve custom post types by custom taxonomies with WP_Query
- 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?
- WordPress wp_query() basic question about args
- Create an archive page for custom post type with custom taxonomy
- Using page slug in wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Custom taxonomy wp_query woes.
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Creating two loops based on different logic
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query parameter conflict
- how to get this tax_query working?
- Different options per post type in WP_Query
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- I am trying to get cutom post cout by month of current taxonmy term
- How to show all taxonomies within custom post type loop
- How to get the post terms from a child taxonomy
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- How to count other posts not having specific taxonomy terms?
- Exclude latest post from WP_Query taxonomy term loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Get posts by category name
- Using WP meta query to show custom post types by a start and finish date
- Foreach loop returning more than one item when querying taxonomy
- 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
- Catergory args causing loop not to show
- 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
- Attaching multiple custom taxonomies to one CPT?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Order Wp Query by earliest of 3 dates meta query
- WP_Query() displaying past post / event
- WP Query Conditionally query meta and taxonomy
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Query custom post type and group by taxonomy
- WP Query – Can’t get posts with specific taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy
- WP_Query not using relation key as expected and not producing any results
- WP Query filtering by custom category not showing all relevant posts
- How to assign a single-menu-template to a menu-items in a taxony/ cat/ subcat/ subcat-item
- Custom fields disappearing when a custom post type is assigned
- wp_insert_term how to insert “” in description