Change featured thumbnail based on screen size
My theme has the option( like any other theme I guess) to chose a predefined featured image size( thumbnail, medium ...etc). I chose the image to be thumbnail, made it 150x150 in media settings but my problem is with 480px screens. Here I want the thumbnail to be full width instead of 150px. If I add width: 100%; rule in CSS I get 150px images stretched to 480px and they look awfull.
The code that outputs my featured images is this:
function omega_entry() {
if ( is_home() || is_archive() || is_search() ) {
if(omega_get_setting( 'content_archive_thumbnail' )) {
get_the_image( array( 'meta_key' = 'Thumbnail', 'default_size' = omega_get_setting( 'image_size' ) ) );
}
...etc}
...etc}
and I want to have another featured image size for max. 480px, nothing fancy, just as that:
?php the_post_thumbnail('thumbnail', array('class' = 'myclass')); ?
I know that resolution may be obsolete but I want my website to look decent on most devices, event the lowend ones. I guess CSS media queries can't help me here and beside those my knowledge is limited.
Thank you so much for any help.
Topic content-width responsive post-thumbnails Wordpress
Category Web