You will have to pass the year in the args for example:
$args = array(
'year' => '2012',
);
Related Posts:
- Use REGEXP in WP_Query meta_query key
- WP_Query orderby date not working
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- Get Recent Posts by Date in Multisite
- $wp_query initiation?
- Changing Posts Per Page and offset with pre_get_posts
- Ignore a filter on the media library
- How to get any tag ID
- How can I hide posts that are over 2 years old
- Which filter/action hook gets triggered after a query has been performed?
- Use meta_query to display events by date in custom field
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- Removing posts from the returned wp_query. Cannot use object of type WP_Query as array
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- How to show recent and upcoming birthdays using meta_query
- Use ‘parse_query’ filter to show posts that from multiple criteria
- What is considered a default query for the request filter?
- Using apply_filters(‘the_content’, $custom_query->post_content) alters output
- Modifying the Search Results
- Tell wordpress to show a single page instead of an archive
- WP_Query meta_query >= date
- Query total number of posts
- How to add post_distinct filter to WP_Comment_Query?
- Comparing dates in custom field
- Using Ajax to load more posts | Help me change the wording on my button to notify the user
- List of the years with posts presented
- How to display upcoming events by dat with Modern Events Calendar Lite
- Orderby ASC changes to DESC in WP_Query
- Display posts from only one post form in custom query and exclude in main query
- Filtering WP_Query
- Order by title without taking into account ‘the’
- How to filter, restrict and return posts based on custom user meta information
- Filter posts in category archive page by year using a dropdown
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- Applying posts_clauses filter to specific queries only
- Add class to first post in custom loop using post_class filter
- Filtering out child category posts from parent category archive not working
- WP_Query with different postmeta filter for each categories
- Add posts to WP Query object
- Taxonomy and Date in same query?
- Shortcode for latest -not expired- posts
- date_query seems to be ignored by wp_query
- WP Group posts by year(desc) > month(desc) > date(asc)
- how to access query string in wordpress?
- Filter Custom Taxonomy Posts
- Include posts from some categories while excluding from others
- Filter post query to only show direct children of category
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Display if author page is author page of current user
- Change AJAX filter from POST to GET for URL Parameters
- Using post_where filter only on main query NOT sidebard new WP_Query
- 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
- 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
- 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
- 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
- Filter sub-category from checkbox form
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- 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?
- Comparing Meta Field date in WPQuery using Meta_Query?
- How to get only present and past posts with post_date
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Sorting query_posts() with a complex orderby filter
- WP Query filters active on wrong query
- 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 posts by birthday
- WP_Query doesn’t works inside loop
- Track write actions to the database
- Show full category tree for a year with all post titles?
- Fetch only categorized posts
- Get X posts for all post types on Taxonomy term archive
- Add filter to Orderby Parameter using Array
- Get post closest to today
- How to add archives (with pagination) to page template?
- query post based on comparison
- 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
- query only direct child and sub-terms of a current term archive
- the_excerpt() not working in custom archive
- 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)