Viewing 8 replies - 1 through 8 (of 8 total)
  • I’m looking for the same thing. If I got the solution I’ll include it here later.

    I waster 2 hours … to realize that i havent set to any of my taxonomies an image … so i set an image to every term in my taxonomies, upload again te code… And all works fine (I’m such a tonto!)

    The code is this

    <?php
    $terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy' => 'categoria-proyecto') );
    foreach( (array) $terms as $term) {
    echo wp_get_attachment_image( $term->image_id, 'destacado-proyectos-home' );
    }?>

    Where “categoria-proyecto” is my taxonomy slug and “destacado-proyectos-home” is the custom image size.

    Feel free to add echo and code.

    And that’s it!

    By the way. I am using wp-types plugin to set custom post types and taxonomies. And works perfect!!!

    Thread Starter Dan Knauss

    (@dpknauss)

    What you are doing there is just a listing of all the term images that exist for one term. I want to get only the terms for the post (single post view). I found a slightly insane but working way to do that in this thread: https://www.ads-software.com/support/topic/querying-for-image-of-term — is there no better way?

    I’ve finally figured out how to get the category images for each individual post.

    <?php
    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
    'after'        => '</div>',
    'after_image'  => '</span>',
    'before'       => '<div class="my-custom-class-name">',
    'before_image' => '<span>',
    'post_id'      => $post->ID,
    'taxonomy'     => 'YOUR-TAXONOMY',
    ) );
    ?>

    Just replace “YOUR-TAXONOMY” with whatever you custom taxonomy is.

    Thread Starter Dan Knauss

    (@dpknauss)

    Thanks for sharing that. Is there documentation you found about this?

    No, this is basically from me trying everything possible. Ended up being more simple than anything else.

    Thread Starter Dan Knauss

    (@dpknauss)

    I guess I did not read down as far as “Here’s an example of what a fully customized version of this filter might look like…” on the main plugin page. I wish plugins like this would just follow the Codex’s template for documentation.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Use outside taxonomy term archive page templates’ is closed to new replies.