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
- ACF – Tags not showing up in Custom Post Types
- Hide load more button if no more post in selected category
- Remove url rewrites for registered taxonomies
- Received nothing after executing AJAX post function
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Filtering WP_Query Dynamically on the Front-End
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- CPT UI change custom taxonomy url
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Get template part using a custom taxonomy term
- Retrieve value of a category’s custom field
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Adding a custom post type taxonomy template in plugin
- Get post from custom post type order by two taxonomies
- Loading custom content type from ajax results?
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to restrict users and admin from creating new taxonomy terms?
- Posts from all the categories are being displayed instead of particular category
- How to save custom taxonomy from front end post submission
- How to convert custom post type based list to a dropdown list?