Ascending order in Post Slider

kevinfung.imi's Avatar

kevinfung.imi

23 Apr, 2020 08:06 PM

I have set the order by "Date" for my Post Slider. But how do I change the order to Ascending instead of descending?

I assume it is to be set in the PHP but would you give me some advice on how?

Thanks!

  1. Support Staff 1 Posted by Dmitry Semenov on 24 Apr, 2020 04:47 PM

    Dmitry Semenov's Avatar

    Hello,

    yes, you'll need to use php filter http://help.dimsemenov.com/kb/wordpress-royalslider-advanced/wp-mod...

    function newrs_custom_query($args, $index) {
        $args['order'] = 'DESC';
        return $args;
    }
    add_filter('new_royalslider_posts_slider_query_args', 'newrs_custom_query', 10, 2);
    

    https://developer.wordpress.org/reference/classes/wp_query/#order-o...

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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