add the ‘date_query’ parameter to your query and include the current year.
$args = array(
'post_type' => 'news',
'posts_per_page' => 5,
'post_status' => 'publish',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'week',
'field' => 'slug',
'terms' => date("W", strtotime("this week")),
)
),
'date_query' => array(
array(
'year' => date("Y")
)
)
);
Related Posts:
- The Operator “NOT IN” Does Not Work In tax_query
- WP_List_Table Inside Metabox Not Working on Submit
- Showing current taxonomy terms
- Order posts by (hierarchical custom) taxonomy terms and term children
- Custom permalinks – post type – hierarchical taxonomy’s
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- automatically create taxonomy with same name as post title
- Count number of posts which exist in 2 taxonomies?
- Display taxonomy term only if there’s a value
- Adding Custom Taxonomy to WordPress default Post type
- Query for custom post type objects in a taxonomy and with a meta value
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Making pages also serve as taxonomies? Or give full pages to taxonomies?
- get_queried_object error How to show post count by month in the taxonomy page
- How to filter the taxonomy terms based on another taxonomy term
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Show Two custom Post type and their posts on category page
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Missing Posts in Custom Taxonomy List
- Disable block with taxonomies at post page
- Tax query not producing any results
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- How to Filter custom post type by taxonomy?
- Get related posts of child term of custom post type
- How do I display the grand child items of a taxonomy term?
- 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
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- How to Display Posts From Category Within a Custom Taxonomy?
- WP_Query parameter conflict
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- display posts of custom post type with custom taxonomy
- tax_query (if the terms are empty)
- How to query Posts from a custom post type which contains a custom taxonomy?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Different structure/content for posts from a custom post type
- List all posts in taxonomy term
- custom taxonomy listing returns no posts
- Making a form for user to add new custom post with custom taxonomies and custom fields
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- custom post type and a “sticky” position taxonomy
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- What is the best way to structure posts for the same event happening in different years?
- Right way to store a large set of similar information on website? [duplicate]
- Define multiple prefixes for custom post type
- How to search through all child taxonomies using WP_Query?
- I cannot display custom posts in custom taxonomy
- Custom search for a custom post type in WordPress
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- How to manage a dynamic multi-level page hierearchy system?
- Display title of all custom posts from same taxonomy term on a custom post template
- tax_query not working?
- Getting Custom Posts with Custom Taxonomy
- WP Query tax_query not returning posts
- How to get all posts related to a taxonomy?
- Error get_posts with Custom Taxonomy and OR relation
- Filter By Term Not Working – Custom Post Type
- How to show post which has the specific taxonomy terms?
- Custom Post Status & Taxonomies
- Post Editor: display categories from current post type taxonomy only?
- tax_query showing no results
- Linking custom taxonomies and posts
- How to Associate Posts with Pages
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom My account page and custom page for editing posts
- Get custom post type parent category
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- WP Query Conditionally query meta and taxonomy
- Sort ACF by custom taxonomy
- How to develop Knowledge center in WordPress Website
- How make get_next_post() return first post when viewing last one
- Exclude from search all custom posts which are NOT in a taxonomy term
- wp_insert_post custom taxonomy
- ascending order custom post type
- Append taxonomy terms as class names in markup?
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- is there a way to retrieve posts that do not have a featured image assigned?
- Custom Taxonomy Permalinks Redirection
- shortcode to show custom post types by category
- Single Template that can be applied only via URL
- Display a grid of taxonomy terms at root taxonomy page
- posttype/taxonomy/term archive page 404 error
- How to add attributes to taxonomies that may be different from post to post?
- Custom post type, permalinks, taxonomies and blog posts
- Conditional for a Single Post That Belongs to a Category?
- Hide custom post type from search based on custom taxonomy
- Replicating category/location page heirarchy
- Non-permalink custom taxonomy not found
- Looking up custom taxonomy IDs by name
- post type => ‘any’ not applied my custom queries
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Custom taxonomy- only output relevant terms
- Prevent repetitive terms in get_the_term_list
- Category / Custom Post Type permalink issue