• Resolved Jules Colle

    (@jules-colle)


    The query below is supposed to return terms, ordered by count, but it doesn’t work when the plugin is enabled. When I disable the plugin it works.

    get_terms('priority-tags', [
    	'hide_empty' => false,
    	'orderby' => 'count',
    	'order' => 'DESC',
    	'number' => 5,
    	'menu_order' => false
    ]);

    Is there a way to force the query to ignore the menu_order?

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

    (@tdgu)

    There are 2 methods to make it work:

    1) Turn of the Auto Sort, which auto apply the order to all queries, then include the 'orderby' => 'term_order' within the queries where the order is required to apply.

    2) If need to keep the Auto Sort active, add the 'ignore_term_order' => TRUE to your query arguments, so it will ignore the custom order

    Thanks

    Thread Starter Jules Colle

    (@jules-colle)

    Thanks!

    Thread Starter Jules Colle

    (@jules-colle)

    None of these approaches work when you are getting results via an ajax call.

    Please consider updating taxonomy-terms-order.php line 134 to

                if (is_admin() && !DOING_AJAX) {
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘order terms by count’ is closed to new replies.