1

I am querying the terms in a custom taxonomy i have with the following code:

<?php 
    $term_id = 2;
    $taxonomy_name = 'rete';
    $termchildren = get_term_children( $term_id, $taxonomy_name );

      $args         = array(
      'child_of' => $termchildren->term_id,
      'orderby'  => 'id',
      'order'    => 'DESC'
      );

 $term = get_terms($taxonomy_name, $args);

    echo '<ul>';
    foreach ( $termchildren as $child ) {
        $term = get_term_by( 'id', $child, $taxonomy_name );
        echo '<li><a class="uno">' . $term->name . '</a></li>';



    }
    echo '</ul>';


  ?>

Works fine but do not order! The problem i have is that i would like to order it by title-order or something similar.

Can anyone suggest what i need to do? Thanks.

1 Answer 1

0

Change the orderby from "title" to "name". See here for a list of acceptable arguments.

1
  • I've tried but do no works
    – Mko
    Oct 12, 2015 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.