Order the WordPress Entries by Modified Date
Lately I write a continuing blog post about my endeavor to migrate my Snow Leopard Server to Lion. Because I am going to update it multiple times until I am done I want the post to appear on the top of the list after I updated it. It took some time to accomplish it but that is how you can do it:
- Open the index.php page of your theme in the Editor of your choice
- Look for the line with the function query_posts
- Add this text to the query orderly=modified and you might need to add an Ampersand if there are more arguments
- This was my original text: <?php query_posts($query_string.’order=DESC’);
- Now it looks like this: <?php query_posts($query_string.’orderby=modified&order=DESC’);
- Save the file
- Reload the page multiple time to make the cache to catch up (my main page remained all white in the first few requests)
Now you should have the post ordered by the modified date and whenever you do update a post it will be listed at the top. Just keep in mind any update no matter how small will do that.
– Andy
Comments are closed.