Custom Query Fields
How to sort by ascending order? (4 posts)

  1. Danjiro
    Posted 4 years ago #

    im trying to sort posts using custom field numerical values. it will order it by descending values by default but i would like the option of going back and forth between DESC and ASC. Can anyone tell me how to do this with the URL? THANKS!


  2. wakingmedia
    Posted 4 years ago #

    I have the same question -- I see that it defaults to DESC, how do I add ASC?

  3. JoZu
    Posted 4 years ago #


    LINE 39:

    'order' => 'DESC', //[ASC] [DESC]

    change for ASC

    Nice plugin for sort post by price range!

  4. Stefan
    Posted 3 years ago #

    No need to edit the plugin file directly.

    When registering your Query Field just add the sorting into the array:

    register_custom_queryable_field("price", array("dataType"=>"numeric", 'order' => 'ASC',));

    You can only choose between "no sorting" AND ASC OR DESC. Haven't figured it out jet how to switch between ASC and DESC.

    Regards Stefan

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Query Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic