Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Sort Query by Post In

A very simple plug-in that allows post queries to sort the results by the order specified in the "post__in" parameter.

NOTE: This plug-in has been incorporated into WordPress core as of version 3.5.

Sort Query by Post In is a very light weight (less than 10 lines of code) plug-in intended for developers executing custom post queries. You're welcome to include it in your theme and redistribute - just offer us some credit, please!

When constructing a WordPress post query in your theme template files or plug-in, WordPress offers the option to explicitly specify the posts to retrieve using the post__in parameter. Unfortunately, the orderby parameter does not offer an option that will sort the result by the exact order passed in the post__in parameter. This plug-in adds a post__in option for the orderby parameter that will order the result by the exact order specified in the post__in parameter.

And don't worry about the plug-in being deactivated - your post queries with the new post__in value used for orderby will simply gracefully fall back to the default date sorting.

Requires: 3.0 or higher
Compatible up to: 3.4.2
Last Updated: 4 years ago
Active Installs: 50+


5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1 100,3,3