• Resolved David Sword

    (@davidsword)


    I appreciate all your hard work. I looked through the source code to try and answer this myself, and it’s very well written *tip of the hat*

    My issue is, I need to get the tax image for a term, far-far away from any standard get_terms() call (i.e.: calling from one of the “unsupported template file“).

    I don’t need anything awesome like you did with the image ID appending to a get_term() call or anything (great ease of use for doing that btw), but basically, is there anyway to do something simple like:

    taxonomy_images_plugin_get_term_image('term', 'tax')

    which just returns an image object or ID.

    https://www.ads-software.com/plugins/taxonomy-images/

Viewing 1 replies (of 1 total)
  • Thread Starter David Sword

    (@davidsword)

    I found it like this, but seems ..messy..

    $get_termtax = $wpdb->get_results("SELECT term_taxonomy_id FROM {$wpdb->prefix}term_taxonomy WHERE term_id =".$termid);
    
    $assoc = taxonomy_image_plugin_get_associations();
    
    $image = wp_get_attachment_image_src($assoc[$get_termtax[0]->term_taxonomy_id]);
    
    echo $image[0]; //the src
Viewing 1 replies (of 1 total)
  • The topic ‘Get Image ID outside of apply-filter’ is closed to new replies.