WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Post Sorting Reloaded] Sorting by custom field

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author gab.ro

    @gabro

    I think it should be possible.

    Some SQL magic in the “Sort type” field could probably do it.

    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

    @gabro

    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

    @gabro

    Just wait a few minutes for the plugin directory to update.

    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/

    Plugin Author gab.ro

    @gabro

    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

    @gabro

    Finally figured out how to sort by custom fields: see here.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] [Plugin: Post Sorting Reloaded] Sorting by custom field’ is closed to new replies.