Sorting results by a custom order

Forums › Forums › Search & Filter Pro › Sorting results by a custom order

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #30675

    I have not been able to figure out how to manipulate the sort results without manipulating all loops.
    I have added this to my functions file:
    function env_sort_res() {

    if ( is_admin() ) return;

    if( is_main_query() ) {
    set_query_var(‘orderby’, ‘menu_order’ );
    set_query_var(‘order’, ‘ASC’ );
    }

    }
    add_action(‘pre_get_posts’, ‘env_sort_res’, 99 );

    what can I do to just target the loop on the results page?

    Ross Moderator
    #30676

    Why not use the built in ordering options in the Posts tab in the S&F edit screen?

    The next release actually adds a second sort option too.

    Thanks

    Anonymous
    #30677

    Because I couldn’t find that option…Thanks!

Viewing 3 posts – 1 through 3 (of 3 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.