Custom Sizes for Featured Image
-
Hello RICG team. I’m trying to use a custom sizes array when calling the_post_thumbnail.
I’m able to use custom sizes on the_content without a problem using the code below. I even figured out that it doesn’t have to be placed in functions.php, but if placed at the top of various template files using different size values for each template, it pulls in the unique size values for on that specific template, which is great!
add_filter( 'tevkori_image_sizes_args', 'benoit_custom_sizes', 10, 3); function benoit_custom_sizes( $args, $id, $size ) { if ( $size == 'full' ) { $args['sizes'] = '(min-width: 768px) 62.2vw, 93.75vw'; } return $args; }
Is there a similar filter/function for editing the sizes array of the_post_thumbnail? As of now, I can see that the plugin works on featured images, but it puts in the default “(max-width: imagewidth) 100vw, image width” sizes array.
Thanks!
-Nick
https://www.ads-software.com/plugins/ricg-responsive-images/
- The topic ‘Custom Sizes for Featured Image’ is closed to new replies.