I'm using the following code to print out the srcset for my image:
<?php if ( function_exists( 'wp_get_attachment_image_srcset' ) ) :?>
srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_post_thumbnail_id( $blog_results->post->ID, 'medium' ) ) ); ?>"
sizes="<?php echo esc_attr(wp_get_attachment_image_sizes( get_post_thumbnail_id( $blog_results->post->ID, 'medium' ) ) ); ?>"
<?php endif; ?>
The container that I'm using has 350px width, however WordPress returns this:
sizes="(max-width: 300px) 100vw, 300px"
I would like to enforce somehow to get the next available size because the image quality is really poor. I've been searching for a solution to this up until now but without success.
Is there any clean way I could accomplish this without hard coding "sizes"?