How to change the order of posts within the loop in WordPress


Image Source: ullajj – Pixabay.com / License: CC0 Public Domain If you’re not happy with the way WordPress sorts and displays your posts by default, then you’ve got two choices: either (1) change the Loop code (either by changing your WordPress theme or by coding a custom Loop) or (2) pick a plugin. Sometimes, for whatever reasons, you would like a little more flexibility to order posts than WordPress provides out of the box. If you want to sort posts by different criteria, for instance, then there are a number of plugins that can help. Before we look at a few of those plugins, however, let’s examine what the Loop is, and how it normally sorts content.
Understanding the Loop
So what is the Loop? Well, it’s not just a plot point in Westworld – though, come to think of it, it’s not far off, either! The Loop, essentially, is the code that decides what gets displayed on any part of your WordPress-powered site – that is, in your dashboard’s list of posts or on the site itself, including the homepage (or blog page, if you’ve configured your site with a static home page instead of blog posts) or any archive-based page (e.g. category
Source: https://managewp.org/articles/13909/how-to-change-the-order-of-posts-within-the-loop-in-wordpress




source https://williechiu40.wordpress.com/2016/11/28/how-to-change-the-order-of-posts-within-the-loop-in-wordpress/