Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Peter J. Herrel

    (@donutz)

    Hi @zamensis, I’m glad you find it useful. You can modify the query args with the wp_wlh_shortcode_query_args filter. To sort the posts by title, put the following in a custom plugin or in the functions.php file of your (child) theme:

    add_filter( 'wp_wlh_shortcode_query_args', 'zamensis_wp_wlh_shortcode_query_args', 10, 1 );
    function zamensis_wp_wlh_shortcode_query_args( $query_args )
    {
        $query_args['order'] = 'ASC';
        $query_args['orderby'] = 'title';
    
        return $query_args;
    }

    More info on the order and orderby parameters in the codex entry for WP_Query.

    Thread Starter Zamensis

    (@zamensis)

    Fast and useful, just like your plugin. Thanks again. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order by name’ is closed to new replies.