I have a little image slider where the images are nicely responsive, but I’d like to serve them dynamically using WP’s Featured Image option. The trouble is, WP forces the size of the Featured Image.
Currently the images are CSS backgrounds styled like this:
.slider-image{ background-image:url('the-image.svg'); background-position:center; background-size:100%, auto; }
I’d rather call the image in PHP like this:
if ( has_post_thumbnail() ) { the_post_thumbnail(); }
…but still be able to style it with the same width:100%, height: auto;
options.
It’s been driving me crazy for ages; anyone out there already solved this problem?