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.

Post Sorting Reloaded

Description

Warning: This plugin is no longer supported. It’s functionality has been included into a new plugin called Nano Plugin Manager.

The plugin is basically a wrapper for the posts_orderby filter. You can sort cateogry pages, author pages, tag pages, pretty much any page that can be targeted with WordPress conditional tags.

Posts can be sorted by title, date, excerpt, comment count, content, or any other field in the wp_posts table.

Just take a look at the first screenshot and everything will become clear 🙂

The plugin also includes a widget that allows regular visitors to sort posts.

Plugin homepage here!

Screenshots

  • Settings screen
  • Widget screen

Installation

  1. Upload post-sorting-reloaded to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

Can I sort by custom fields?

Yes and no. In order to sort by custom fields, you also need to use the posts_join filter in addition to the posts_orderby filter.

For the posts_orderby filter you can use the plugin, but for the posts_join filter, you’re going to have to write the code yourself.

Just add the following code either in your theme’s functions.php or in a new little plugin:

add_filter('posts_join', 'my_posts_join');

function my_posts_join($join){
    global $wpdb;
    $join .= " LEFT JOIN $wpdb->postmeta wpmeta ON ($wpdb->posts.ID = wpmeta.post_id AND wpmeta.meta_key = 'price')";
    return $join;
}

Replace ‘price’ with whatever your custom field is called.

Now you have access to your custom field by using wpmeta.meta_value as your Sort Type.

Of course, if you need the numerical value of your custom field, you can use something like ABS(wpmeta.meta_value).

Contributors & Developers

“Post Sorting Reloaded” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.3

Removed contextual help. The plugin is now tested and works properly for WordPress 3.3.1

1.2

Minor bugfixes.

1.1

Added class for selected option in the widget.

1.0

Everything is working properly. Minor security bug fixed.

0.9

Added widget for frontend sorting. User testing went on smoothly.

0.8

Initial release. Should work perfectly, but I’ll wait for a bit of user testing before calling it 1.0