• Below is the code that I'm using to display images and the names of terms associated with a single post in my custom post template.  This works fine, however, I need to sort the terms and images by the term id ASC.  Is that possible with this code?


    <div class='my-taxonomy'>

    <?php print '<b class="me-bold">My Taxonomy: </b>';?>

    <div>

    ? ? <?php

    $terms = get_the_terms( $post->ID, 'my-taxonomy' );

    foreach ($terms as $term) :

    ? ? $terms = apply_filters( 'taxonomy-images-get-terms', '', array(

    ? ? ? ? 'taxonomy' => 'my-taxonomy',

    ? ? ? ? ? ? 'term_args' => array(

    ? ? ? ? ? ? ? ? 'slug' => $term->slug,

    ? ? ? ? ? ? ? ? )

    ? ? ? ? )

    ? ? );

    ? ? foreach( (array) $terms as $term) :

    ? ? ? ? ? ? echo wp_get_attachment_image( $term->image_id, 'full', array('class' => 'alignnone'));

    ? ? ? ? echo $term->name;

    ? ? endforeach;

    endforeach;

    ?>

    </div>

    </div>
    • This topic was modified 3 months, 2 weeks ago by gchalk.

    The page I need help with: [log in to see the link]

  • You must be logged in to reply to this topic.