I'm trying to add the taxonomy image to archive pages on my site (using the taxonomy image plugin). I'm using this code in functions.php:
add_shortcode('wpv-taxonomy-image', 'taximage');
function taximage($atts) {
global $WP_Views, $wp_query;
$term = $WP_Views ->get_current_taxonomy_term();
$wp_query->queried_object = $term;
$filtered = apply_filters( 'taxonomy-images-queried-term-image', '' );
$wp_query->queried_object = wp_reset_query(); // restore the original wp_query
return $filtered;
}
It works!... but it always uses the thumbnail version of the image. I want to use the "full" size. I tried using the "size" attribute in the shortcode, like this:
[wpv-taxonomy-image size="full"]
, but it isn't recognized. Is there something I can add to the function to achieve this?
Hi ianM,
Are we talking about the plugin "Taxonomy Images", download from:
https://wordpress.org/plugins/taxonomy-images/
As their document mentioned, you can set custom size, like this,
Replace this line from:
$filtered = apply_filters( 'taxonomy-images-queried-term-image', '' );
To:
$filtered = apply_filters( 'taxonomy-images-queried-term-image', '' , array('image_size' => 'medium') );