You’ve made “orderby” and “order” part of the date_query sub-array. “Order” parameters belong to the main parameters array.
I can’t vouch for the part of your code that concerns the year and the above-undefined variable $ppy, but if you want the posts from a specified year in ascending order by ‘post_date’ (which is the default), you’d try:
$args = array(
'date_query' => array(
'year' => $ppy,
),
'order' => 'ASC',
);
You can leave off ‘post_date’, since it’s the default, but it doesn’t hurt to specify if you’ve got a lot else going on that may potentially change the query.
Related Posts:
- WP_Query orderby date not working
- Ordering by meta_value AND date NOT WORKING with wp_query
- Complex WP_Query order request: DESC by day, but then ASC by time
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- Get post closest to today
- Get posts that were most recently tagged
- WP_Query sort by ACF date field (newest first) with blank dates first
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Order by optional meta key?
- Sorting: custom query with orderby meta_value_num THEN by title
- WP_Query order by multiple meta keys & fields
- How to get order of posts?
- Order posts by ID in the given order
- Get Recent Posts by Date in Multisite
- Sorting posts by custom date fields (non standard date format)
- How do I order pages and categories by ID or name in the same query?
- WP_Query sort by comment meta data
- Order posts by tags count?
- Merge 2 args in one WP_Query and order it by date
- Orderby = none not working [duplicate]
- WP_query ‘orderby=none’ Problem
- Revolution Slider Orderby Two Custom Fields
- Date query not inclusive despite parameter being true
- Use meta_query to display events by date in custom field
- WP_Query orderby breaks when using AJAX?
- Custom Post order for homepage
- Change default ordering of taxonomy terms – pre_get_terms
- How to show recent and upcoming birthdays using meta_query
- WP_Query Order by Specific Post ID First
- Sorting posts DESC based on the number of comments using WP_Query
- WP_Query meta_query >= date
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- (Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array
- How to set multiple `orderby` in query argument?
- WP_Query order result by date AND meta_value
- Order by title without taking into account ‘the’
- WP_Query orderby author__in
- Weird orderby => post__in issue
- Order by empty custom field
- How to order posts by title after they have already been sorted by category
- Advanced ordering of query_posts
- Help ordering Post loop by two meta values
- meta_value_num not ordering all items
- 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)
- Ordering posts by an array
- How to Create a Random List of Child Pages
- WordPress Custom Search Form Displaying Unexpected Results
- Specify strict ‘order by’ in WordPress query
- Order is breaking wp_query
- Filtering posts by archive showing all years
- How order posts from category by date and comment count?
- Child pages not affected by orderby
- Ordering posts by custom field and grouped by month
- WP_User_Query orderby meta_val_num
- WP_Query custom order and pagination
- Show single posts date, in a page of posts
- Sorting posts by Multiple custom fields in defined order
- Added Date Filter To Popular Posts Query
- Sort posts using multiple custom fields and menu_order in single query?
- WP_Query order by multiple meta keys & fields
- How to sort wordpress posts already selected by WP_QUERY
- Custom WP Query order function possible?
- Custom order of posts in wp_query and different taxonomies
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- WP_User_Query Orderby Not Working
- Order by value of Custom Field using url string
- Order posts by tags count?
- Order Element By Custom Field in WordPress
- Query Order By Number Variable From API
- Order 2 meta_queries differently in WP_Query?
- Sorting with meta_query and multiple, optional meta keys
- WP_Query: custom orderby (not ASC nor DESC)
- Order & Orderby clause not working with custom query
- Best way to Order Post in Home without a plugin
- orderby in WP_QUERY – Use the order from the Dashboard
- Query All Attachments and Order by Parent Publish Date
- Using orderby with 2 meta keys
- Order posts by custom column using pre_get_posts
- Add filter to Orderby Parameter using Array
- Order WP_Query results in order other than ASC or DESC
- Custom query to order by multiple taxonomies
- Year based WP Query
- Sorting: custom query with orderby meta_value_num THEN by title
- query_posts with sorting on a custom datestamp
- Query custom post type by date field only working when two posts match the query
- Get posts from similar time as current post
- Divide WP_Query posts by date & post type
- orderby in WP_query doesn’t works
- Query Posts by date range with fixed beginning and end
- Issue with sorting by post date and custom post type
- Posts2Posts, wp_query and orderby issue
- Order by meta values
- Change posts archive ordering
- orderby and order filter in get_posts or WP_query function in wordpress not working
- Order Wp Query by earliest of 3 dates meta query
- Why does wp_query only display the most recent post when using order ASC?
- new WP_Query with order args – no more distinction between categories