I'm having some issues customizing the thumbnail sizes for featured images.
Attempting to register a custom image size of 860x364, that would be used on a blog post page itself, as well as the list of blog articles. I don't want to replace the thumbnail, however as i use it in other areas.
Code:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 860, 364, true );
add_image_size( 'featured-thumb', 860, 364, true ); // 300 pixels wide (and unlimited height)
}
In my single blog post page, calling the image:
<a href="<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full', false ); echo esc_url( $src[0] ); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('featured-thumb'); ?></a>
Does not seem to change anything, what am i doing wrong here. Some strange things with WPRocket inserting picture tags?
HTML:
<a href="http....o.png" title="test">
<picture class="attachment-featured-thumb size-featured-thumb wp-post-image">
<source type="image/webp" srcset="https://...ogo.png.webp 900w, https://...167.png.webp 300w" sizes="(max-width: 900px) 100vw, 900px">
<img width="900" height="500" src="https://...ogo.png" alt="Test" srcset="https://...go.png 900w, https://...167.png 300w" sizes="(max-width: 900px) 100vw, 900px">
</picture>
</a>