Using Taxonomy Image code with my get_categories code

No luck by using plugin provided functions as it gets it’s id by

$obj = get_queried_object();

To get the image I use this code snippet:

$associations = taxonomy_image_plugin_get_associations();
$tt_id = absint( $taxonomy_term->term_id );

if ( array_key_exists( $tt_id, $associations ) ) {
    $image_id = absint( $associations[ $tt_id ] );
}

$image = wp_get_attachment_image( $image_id, 'thumbnail' );

Leave a Comment