PostSlider : sort posts as in the data base

thierry.vieville's Avatar


30 Nov, 2015 05:27 PM

  RoyalSlider is really smart, we use it on including for post-slider and it works fine. However:

- we would like to sort posts not by Date or Comments but ... as it appears in the data base (i.e. when it is listed by the Loop)

   -> it seems to be a simple patch in ./classes/sources/Posts.php and ./classes/GalleryShortcode.php regarding 'orderby' though i am not sure what to do exactly in the former file

Could i get some advice to perform the patch (under MY responsability) or may i suggest to add this to the distrib ?


  1. Support Staff 1 Posted by Dmitry Semenov on 01 Dec, 2015 12:53 PM

    Dmitry Semenov's Avatar
  2. 2 Posted by thierry.vievill... on 01 Dec, 2015 02:09 PM

    thierry.vieville's Avatar

    Really great ! It words fine : with

    // Manages the order in post slider
    add_filter('new_royalslider_posts_slider_query_args', function($args,
    $index) {
        $args['order'] = 'ASC';
        $args['orderby'] = 'menu_order';
        return $args;
      }, 10, 2);

    i obtain the order we need (manual ordering according to the menu display): yet another good point for royalslider
    thanks !!!

  3. thierry.vieville closed this discussion on 01 Dec, 2015 02:58 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac