You have the orderby
parameter in your query but you are missing the companion order
. This gives ascending/descending rule to the sortation.
WordPress Codex reference
Related Posts:
- AJAX with loop filtering categories
- How can I custom order the results from wp_list_categories?
- Exclude filter on front page
- Filtering The Loop For Single Page and Blog Page
- Custom search form to display users only
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Query posts if meta key starts with
- How to return only one instance of each, from the entire loop
- Query reset problem or flawed code to enable custom post type query
- Sort posts by most recently modified
- Combining action and filter?
- Filter the loop by categories using checkbox form
- Filter the_posts doesn’t work on search page
- Sort results by groups of numbers and letters
- Trying to get property of non-object in shortocde
- Sort posts by first letter in the title, not by first number
- Make a loop to return x number of posts, but only if they have content or excerpt
- Filter existing hook using parameter and foreach loop
- How to filter posts by category INSIDE the loop
- Filter or order based on custom field
- Loop order issue with Ajax filter
- Add Search and Filter functionality to custom loop
- Reorder posts in a loop: have the posts by one particular author below the others
- How to filter get previous post function by meta value DESC and post date DESC?
- WordPress redundant posts based on meta field
- Remove posts_orderby filter then add it back in
- Sorting posts to make those with post thumbnail show up first
- Buddypress Group Activity Loop Filter activity type [closed]
- get_posts and wp_autop (remove filter)
- Help with add_filter(‘the_content’, ‘some_function’) and multiple matches
- Applying a filter to multiple loops for days ago
- Custom sortable columns ordered by meta-value?
- How to place comments_template(); outside the loop?
- Endless loop with wp_insert_post and wp_update_post
- How do I prevent one of two multiple loops from repeating on a second page?
- Hook into the loop via a plugin, and output something after every X post?
- Two custom loops, pagination, offset
- How are both HTTP and HTTPS versions displaying?
- Access to Media Library
- How do you split multiple-column loop on category archive page?
- How to Loop within a Loop (Display Children and then Grandchildren)
- Run The Loop over array of post objects
- Enable infinite scroll on single.php [closed]
- How to loop through ALL pages?
- Does get_template_part pull data once in a loop?
- wordpress change the loop order by dynamic value
- Post Format single-loop.php using get_template_part
- A loop with all articles with certain text strings in tags
- Prevent Headers from being sent
- How do I get row padding in a post feed?
- How can I create a legend (Key) like the one in the footer on WordPress StackExchange
- It is possible to encounter horrible bugs if I place a main loop that uses `query_posts` right above the main bbPress loop?
- How do I use AJAX Query in my posts loop?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Make blog page show 10 on first page, 9 on every other page
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- Two loops on different pages do the same thing, but only one page works
- Posts active and expired in different loops
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Using Javascript for Looped Content
- Making a query to the DB using same parameters of loop
- Variable not being passed into WordPress loop
- Exclude duplicated $sticky post from combined loop content
- Getting a custom field in the middle of a loop
- WP Loop. If featured image is a panorama (3:1 ratio) execute some code
- How to Loop with the final result formatted differently?
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Include future posts in tags and in search
- How to use a dropdown to filter posts by custom field
- current-user_can not working in loop
- Show terms in archive page
- Multiple loops for plugin
- Loops for cat links not looping for wordpress site
- Skip 5 latest post while paging?
- Sort posts according to a numeric value entered with ACF
- wp_get_attachment_url not fetching URL?
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- How to get all multi-select user meta values and add them to an array?
- How to resolve a reload loop issue in the frontend when logged in to WordPress multi-site backend admin area
- Exclude Posts Using Meta Query and User Meta
- Excerpt isn’t working or am I missing something?
- Can I temporarily disable global $post?
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- Show a list of user posts in the user admin page
- Infinite Loop after Genesis Theme Upgrade
- Active class for my flexslider in WordPress
- WordPress loop only displays 5 articles max?
- get_template_part() to render single page Theme
- Showing related posts (custom post type) outside of the loop
- Paged homepage – requirements?
- Least Number of Loops to Create Custom Homepage?
- The Loop for my theme with static front page is not working
- WordPress loop: Display if posts exist
- How do I filter a custom post type loop by a field?
- Showing ads after posts in home page
- Prevent duplicating specific column from database table
- Hook in the loop after the first post
- FacetWP custom display based on post type [closed]