• Resolved BenM

    (@alysko)


    Hi,

    Your plugin works fine, thanks, but if I want to rearrange in a specific order, it doesn’t work.

    For example, I use Search&Filter plugin in which I specify an orderby name, but terms stay displayed in custom order.

    Thanks.
    edit: to do it works, I exclude taxo on the page where Search&Filter is.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi, I am not seeing the same thing ??
    I use this shortcode:
    [searchandfilter fields="search,category,post_tag"]
    it will be sorted on name (which seems to be the default in that plugin.
    If I use this shortcode:
    [searchandfilter fields="search,category,post_tag" order_by="term_order"]
    It will omit the order_by and still use name.

    Which shortcode do you use? You really see it set as you set it on the tax_order plugin?

    Thread Starter BenM

    (@alysko)

    Hi, here is my shortcode

    [searchandfilter fields="arborescence,matieres"
    								types="select,select"
    								order_by="name,name"
    								order_dir="ASC,ASC"
    								hide_empty="0,0"
    								post_types="documentation"

    As you can see, this is a CPT. With this shortcode, “arborescence” and “matieres” keep their custom order.

    Plugin Author Marcel Pol

    (@mpol)

    Yes, I see the same. But there is no real way to disable that.

    I did some digging, and the plugin uses wp_dropdown_categories which uses get_terms.
    My plugin filters the output of get_terms in the function customtaxorder_wp_get_object_terms_order_filter.
    There it just uses the list of terms and the setting you set in this plugin for that taxonomy. It doesn’t let you set things individually for each call.

    If you don’t want to filter the result of get_terms, than you can run:
    remove_filter( 'get_terms', 'customtaxorder_wp_get_object_terms_order_filter', 10, 3 );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘orderby doesn’t work’ is closed to new replies.