Custom Taxonomy Sort
How to sort tax_query? (2 posts)

  1. gleenk
    Posted 3 years ago #

    I'm a in a Custom Page and I've installed Custom Taxonomy Sort plugin (turning off automatic sorting). This is my query (not-sorting):

    	'tax_query' => array(
    			'taxonomy' => 'portata',
    			'field' => 'slug',
    			'terms' => array( 'primi-piatti','secondi-piatti')
      'post_type' => 'ricetta',
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'orderby' => 'custom_sort'
    $my_query = null;
    $my_query = new WP_Query( $args );

    How can I make it works?


  2. Zack Tollman
    Plugin Author

    Posted 3 years ago #

    Hi gleenk,

    Custom Taxonomy Sort does not apply to WP_Query. It only applies to when you are querying for taxonomy terms through functions like get_terms.

    Unfortunately, my plugin will be of little use to you in this circumstance; however, I suppose you could use the data stored in the termmeta table to sort the posts only after the query is executed.

    There's also a chance that you can do what you are trying to do that does not involve my plugin at all.



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Taxonomy Sort
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic