Title: [Plugin: Post Sorting Reloaded] Sorting by custom field
Last modified: August 19, 2016

---

# [Plugin: Post Sorting Reloaded] Sorting by custom field

 *  Resolved [matachin](https://wordpress.org/support/users/matachin/)
 * (@matachin)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/)
 * Is any chance to sort posts by a custom field (I’m thinking of sort events by
   date not by publish date)
 * [http://wordpress.org/extend/plugins/post-sorting-reloaded/](http://wordpress.org/extend/plugins/post-sorting-reloaded/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [gab.ro](https://wordpress.org/support/users/gabro/)
 * (@gabro)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797217)
 * I think it should be possible.
 * Some SQL magic in the “Sort type” field could probably do it.
 *  [peter213](https://wordpress.org/support/users/peter213/)
 * (@peter213)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797516)
 * Nice plug in.
    a minor wish list.
    1. ability to add plugin in manually to templates
    2. add some classes to help specify what has been selected
 * peter
 *  Plugin Author [gab.ro](https://wordpress.org/support/users/gabro/)
 * (@gabro)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797517)
 * Thanks Peter,
 * 1. You can always register a little sidebar in your functions.php, display it
   somewhere in your template and then add the widget there.
 * 2. Solved. If you upgrade to version 1.2 you can use the `%class` tag in the “
   Item format” field. It will either output `class="psr-selected"` or `class="psr-
   deselected"`.
 * Gab
 *  Plugin Author [gab.ro](https://wordpress.org/support/users/gabro/)
 * (@gabro)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797518)
 * Just wait a few minutes for the plugin directory to update.
 *  [Laura McDonald](https://wordpress.org/support/users/laura1234/)
 * (@laura1234)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797559)
 * There is a plugin that would sort by custom field, called wp-smart-sort, but 
   it doesn’t seem to be working in 3.1 anymore. Maybe if you look at that code 
   you’d get some ideas or maybe even be able to fix and incorporate it into yours?
   
   [http://wordpress.org/extend/plugins/wp-smart-sort/](http://wordpress.org/extend/plugins/wp-smart-sort/)
 *  Plugin Author [gab.ro](https://wordpress.org/support/users/gabro/)
 * (@gabro)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797560)
 * I remember I looked at it’s code a while ago, and much of the SQL seemed gibberish
   to me. I’m not that much of an SQL expert.
 * Anyhow, if sorting by custom field is possible with the posts_orderby filter,
   all there would be to it, would be some SQL vodoo in the “Sort type” field, so
   there are no actual code improvements that I can do.
 * All we need is an SQL expert to come and tell us what to write there. I’m guessing
   that joining some tables might be necessary…
 *  Plugin Author [gab.ro](https://wordpress.org/support/users/gabro/)
 * (@gabro)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797581)
 * Finally figured out how to sort by custom fields: see [here](http://wordpress.org/extend/plugins/post-sorting-reloaded/faq/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Post Sorting Reloaded] Sorting by custom field’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-sorting-reloaded.svg)
 * [Post Sorting Reloaded](https://wordpress.org/plugins/post-sorting-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-sorting-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-sorting-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/post-sorting-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-sorting-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-sorting-reloaded/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [gab.ro](https://wordpress.org/support/users/gabro/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-post-sorting-reloaded-sorting-by-custom-field/#post-1797581)
 * Status: resolved