Support » Plugin: Jetpack - WP Security, Backup, Speed, & Growth » Changing image size for Testimonials output

  • Resolved iangeek

    (@iangeek)


    Apologies if this has already been covered, but I’m just tinkering with the Testimonials custom post type generated by Jetpack and the respective shortcode. I can see how to display the full content, but can’t see any way of using anything other than the cropped thumbnail.

    I’d like to masonry-ise the output, so would prefer to be able to use an image that respects the original aspect ratio. I can of course hack the code, but just wondered if you’ve got a filter or hook I can use to override the image output, so I don’t have to re-hack each time the plugin updates?

    Cheers!

    Ian

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic šŸš€

    You can use the jetpack_testimonial_thumbnail_size filter to change the thumbnail size for posts displayed when using the Testimonial shortcode. You can use the filter to set any of the default sizes available with WordPress, or you can use a thumbnail size you’ve created yourself in your theme thanks to the add_image_size function. You can read more about this here.

    In the example below, we’ll switch from the default size (thumbnail) to large thumbnails:

    function jeherve_large_testimonial_thumbnails() {
        return 'large';
    }
    add_filter( 'jetpack_testimonial_thumbnail_size', 'jeherve_large_testimonial_thumbnails' );
    

    You will of course need to place that code in your theme’s functions.php file, or in a functionality plugin.

    I hope this helps.

    Thread Starter iangeek

    (@iangeek)

    Thanks Jeremy – I figured you probably would have left it with a filter. You usually do šŸ™‚

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing image size for Testimonials output’ is closed to new replies.