• Resolved joemastro

    (@joemastro)


    Sigh….

    I can’t find information on how to order terms using wp_get_post_terms. I need it ordered by category/sub-category, and the function wants to order it by name.

    get_term_list will not work because of how I need to display it (custom hyperlinks).

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter joemastro

    (@joemastro)

    Resolved. Need to use wp_get_object_terms

    <?
    $args=array('orderby'=>'parent');
    $product_terms = wp_get_object_terms(get_the_ID(), 'ls-itin',$args);
    if(!empty($product_terms)){
    echo "effing terms here";
      if(!is_wp_error( $product_terms )){
        echo '
    <ul>';
        foreach($product_terms as $term){
          echo '
    <li><a>slug, 'ls-itin').'">'.$term->name.'</a></li>
    ';
        }
        echo '</ul>
    ';
      }else echo"bologna";
    }
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Order terms by term/subterm with wp_get_post_terms’ is closed to new replies.