I have a simple two columns website (one sidebar + one maincoulmn). In the sidebar area I use this code to show some post thumbnails:
<?php the_post_thumbnail('custom-size-small' ,array('class' => 'image', 'title' => strip_tags(get_the_title()), 'itemprop' => 'image')); ?>
My website is responsive and on smaller devices the sidebar drops underneath the main column and when this happens the sidebar becomes as wide as the main column. My 'custom-size-small' is '300px' and you can imagine when the sidebar places under the column, if the viewer is still larger than 300px, the quality of the images suffers. That made me think of this relatively new feature on WP in which srcset is used. But the problem is that the way I want to make use of it is quite the opposite we normally do, is that, bigger images for smaller screens and vice versa.
Can we make WP use the 'custom-size-small' on desktops and the bigger 'custom-size-big' which is twice as big, on smaller screens?
/* I'm not a coder, I can only tamper with the codes. */
That would be great if you could tell me what changes I should make to this?
<?php the_post_thumbnail('custom-size-small' ,array('class' => 'image', 'title' => strip_tags(get_the_title()), 'itemprop' => 'image')); ?>