You will have to pass the year in the args for example:
$args = array(
'year' => '2012',
);
Related Posts:
- WP_Query filtering in ACF field containing dates
- Use REGEXP in WP_Query meta_query key
- WP_Query orderby date not working
- How to list some posts first in the loop based on post id
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- WP_Query – filter or directly?
- What is the most efficient way of querying posts based on visits and date for current day?
- Get Recent Posts by Date in Multisite
- $wp_query initiation?
- Changing Posts Per Page and offset with pre_get_posts
- ajax category filter
- WordPress Custom Query to show posts from last x years
- How to order posts tag by tag?
- Overriding The Loop with filter or hook
- Custom query incorrectly returning everything [closed]
- WP Rest API v2 return posts with specific tag
- WP_Query – How to get all posts of specific days of week by custom field date?
- Multiple wp_query on archive page
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Remove post type filter added by the plugin in the final query
- Ordering posts by custom field and grouped by month
- Creating attachments archive in tags and categories
- Filtering by multiple conditions in the loop
- Limit loop to future events
- How to show list of posts with custom field value (a date) that are coming soon
- Show single posts date, in a page of posts
- Post archive for certain post format
- relation OR instead of AND – Filtered term ID’s in loop
- Can’t order the query result as given posts id’s array
- Added Date Filter To Popular Posts Query
- filter posts by meta key with pagination
- Creating ‘posts page’ loop based on the page itself
- Why does apply_filters behave different inside and outside a loop?
- Custom post type – filter content by custom meta box content
- meta_query weird behaviour, static int will work, but not user data
- get_children() Archive Template
- Filter sub-category from checkbox form
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- In a WP_Query can I force the results’ is_singular() to be set to false?
- My combination of ‘post_type’ and ‘tax_query’ not working?
- Custom meta_query order for Elementor based on post meta key [closed]
- How to add a “base” filter for all posts visible to visitors on the site?
- Pagination not working on archive.php template?
- How do I stop the same post showing multiple times in a archive?
- Comparing Meta Field date in WPQuery using Meta_Query?
- WordPress – Form does not filter the results of taxonomies
- How to get only present and past posts with post_date
- WP Query for all events prior to current date
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Problem with my loops
- Sorting query_posts() with a complex orderby filter
- Sort posts on custom field AND after that sort on date?
- WP Query filters active on wrong query
- Custom category page with taxonomy filters
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- Gather same custom field values in one value in a select tag with wp_query
- get term objects and post objects in query
- How to set selected attribute on option after filter query?
- Get posts by birthday
- Issue generating custom filter for cpt admin columns
- WordPress custom query by archive title
- WP_Query doesn’t works inside loop
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Track write actions to the database
- Show full category tree for a year with all post titles?
- Fetch only categorized posts
- How to allow Readers to Select Post Order?
- Get X posts for all post types on Taxonomy term archive
- Custom query with post_class filter using current_post not working
- Add filter to Orderby Parameter using Array
- Year based WP Query
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Get post closest to today
- Loop the posts between two dates selected using jquery datepicker
- How to add archives (with pagination) to page template?
- Query custom post type by date field only working when two posts match the query
- query post based on comparison
- Get posts from similar time as current post
- Divide WP_Query posts by date & post type
- Query Posts by date range with fixed beginning and end
- Issue with sorting by post date and custom post type
- Do not show a custom post if it belongs to a certain custom taxonomy
- wp_query->set for several categories
- Adding arguments to WooCommerce Product Loop using AJAX
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Edit WordPress loop, taxonomies, & filter
- query only direct child and sub-terms of a current term archive
- the_excerpt() not working in custom archive
- Get posts that were most recently tagged
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- List categories using WP_Query
- I need to get all categories from a WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
- Block Editor – WordPress 6.1 – CPT Archive Issue – While the title changes in the loop, all records display the same data
- How to display only posts from the last day with posts published?
- filter the custom post type using wp ajax request
- Grab IDs of products from WP_Query which is run elsewhere