• Resolved montrealist

    (@spectrus)


    Hi,

    I’ve got a WP_Query with tax_query parameter in one of my plugins, which gets posts based on two custom taxonomies (below). I’d like to be able to sort posts that are returned with it using the plugin. I am able to filter posts by those taxonomies in the ‘Re-Order’ sub-menu, however rearranging them has no effect on the output. Can anything be done?

    $args = array(
        'tax_query' => array(
          'relation' => 'AND',
          array(
            'taxonomy' => 'gender_category',
            'field' => 'slug',
            'terms' => array( $_POST['gender'] )
          ),
          array(
            'taxonomy' => 'age_category',
            'field' => 'slug',
            'terms' => array( $_POST['age'] )
          )
        )
      );

    https://www.ads-software.com/extend/plugins/post-types-order/

Viewing 1 replies (of 1 total)
  • Plugin Author nsp-code

    (@nsp-code)

    Hi Spectrus,
    I see what you mean. The order within the admin is set for individual taxonomies term, but when a query fetch objects from multiple taxonomies/terms, there is no order to apply, for which reason this will fall under the Archive custom order, you should try to re-order that instead.
    Hope it works for you.

    Please feel free to contact us directly for a much faster correspondence as you own a paid code.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘tax_query with Advanced Post Types Order?’ is closed to new replies.