Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Waiting for user confirmation] Display an image based on the category that is selected

$
0
0

I was able to do this with the Taxonomy Images plugin as suggested by some other threads on the forum. The only problem is that the image is getting cropped.

As per Caridad in this thread: https://wp-types.com/forums/topic/including-a-taxonomy-image-in-a-view/

I added the following to my functions.php:

add_shortcode('wpv-post-taxonomy-image', 'taximage');
function taximage($atts) {
return apply_filters( 'taxonomy-images-list-the-terms', '', array( 'taxonomy' => $atts['type'], 'post_id' => get_the_ID() ) );
}

Then I added this shortcode where I wanted the image to appear:

[wpv-post-taxonomy-image type="sector"]

The image appears, but is getting cropped. Is there something I can add to either code to simply get it to resize responsively?

Here's what it looks like now: http://www.gearheaddiva.com/stores/4-wheel-parts/

The image at the top is the one added via the plugin (getting cropped). The image at the bottom is via the old method [wpv-post-featured-image] – I just left it there for now for comparison.


Viewing all articles
Browse latest Browse all 20145

Trending Articles