• Hi there,

    My post title here is pretty self-explanatory: I’d like to be able to get the image associated with any taxonomy by specifying the taxonomy’s ID, not be being currently on the archive page of the taxonomy or whatever.

    I’m not a big fan of the new “apply_filters everywhere” approach but at least it works.

    Here’s my quick addition to get what I actually want:

    function get_taxonomy_image($term_id, $size = 'post-thumbnail') {
    
      $associations = taxonomy_image_plugin_get_associations();
    	$image_id = absint( $associations[$term_id] );
    
    	return wp_get_attachment_image( $image_id, $size );
    }

    Once again, something similar should definitively make it to the plugin’s core.

    Thansk for your great work.
    Jeremy

Viewing 16 replies (of 16 total)
  • I hate to start this thread up again, but I’ve read it twice and still feel lost.

    I have a custom post type with a custom taxonomy on it that has images on some terms.

    On each single post of that custom post type I want to generate a list of the taxonomy image and taxonomy term name for each term assigned to that single post.

    It seems like there isn’t a filter designed to do this. I was trying to play with using wp_get_object_terms and then using that to somehow loop through the result of ‘taxonomy-images-get-terms’ but that’s beyond my current PHP skills.

    Any tips or pointers would be greatly appreciated.

Viewing 16 replies (of 16 total)
  • The topic ‘[Feature Request] Get specific term image, not queried term image’ is closed to new replies.