I have a WP slider with costum img sizes (fixed width and height) and i need that they would scale to fixed 330px height, and auto width. how to achieve this?
thank you in advance!
I have a WP slider with costum img sizes (fixed width and height) and i need that they would scale to fixed 330px height, and auto width. how to achieve this?
thank you in advance!
You must be logged in to post a comment.
As this was specific wordpress question and I found an answed, i will share it. When you add custom image size to functions.php, add 9999 to width and hardCrop to false.
First when importing them via the media manager you can define the native size. Otherwise you will have to hard code them like @Dan Grossman mentioned. We need more info. Site link and slider name?
It sounds like you already have a pretty decent idea of what you need. Use css to do this.
For example:
You’ll want to target based on class (rather than all images with
img{...}
). I haven’t used WP Slider, but I’m assuming that it will add a custom class to images in the slider. If so just use your in-browser developer tools, or view source, to see what class is being added to these images, then create the css like the above.