I'm using Toolset Views to display a list of taxonomies. These taxonomies are under a custom Taxonomy that I created with Toolset Taxonomies. I then used the plugin Taxonomy Images to add the option to have an image related to a term. I'm using a flat hierachy (tags) if that have any impact.
What I'm trying to achieve is that in the Views Loop I want to display the image that I have added to the term.
Views Loop:
<wpv-loop>
<img src="[sagaio-term-image size='thumbnail' id='[wpv-taxonomy-id]' output='url']" />
<h4>[wpv-taxonomy-title]</h4>
</wpv-loop>
My shortcode code:
function get_taxonomy_image( $atts ) {
$atts = shortcode_atts( array(
'image_size' => 'thumbnail',
'id' => '',
'output' => ''
), $atts );
add_shortcode( 'sagaio-term-image', 'get_taxonomy_image' );
Question:
How do I get the attachment ID for the specified taxonomy and output the URL?
I have looked at wp_get_attachment_image_src
but I don't know how to get the ID of the attachment...