Support » Plugin: Taxonomy Images » [Plugin: Taxonomy Images] Use Taxonomy Image On single.php

  • I am trying to associate an image to each term as a background image using an inline style, on the taxonomy.php it is no problem because I can use $image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '', array('image_size' => 'full')
    But on the single.php I am struggling to just call the url of the image, I am able to add the image associated on the page with

    <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
    	<?php $cats = $object_terms = wp_get_object_terms( $post->ID, 'producttype' );
    foreach ( $cats as $c ) {
        $url = get_category_link( $c->term_id );
        $img = $taxonomy_images_plugin->get_image_html( 'full', $c->term_taxonomy_id );
        if( !empty( $img ) ) ?><?php echo $img ?><?Php }?>'

    but I only need the image url not the <img src=”” etc./>

    I am thinking that I need alter get_image_html to get_image_url or someting similar but am struggling to find any literature about this.

    Any help would be appreciated

  • The topic ‘[Plugin: Taxonomy Images] Use Taxonomy Image On single.php’ is closed to new replies.