0

I don't really get it. I use the function add_image_size to add a custom size so that I can display a feautred image with the nickname of the custom size. Using add_image_size I set the height to 300px and I look for the value of the width so that the image spans all the way across. But I can't make it, past 1100 the image doesn't stretch anymore, and also when I use smaller values such as 600 for the width I see that it also affects the height.

Why is that? Aren't the width and the height supposed to be independent? And what is the correct way to set the values of the width and the height so that the featured image will span all the way across the browser with a certain height?

Thanks in advance

  • Are you searching for this? I thing it is. stackoverflow.com/questions/46133076/… – Naga Raj May 6 '18 at 7:06
  • The add_image_size() defines the dimensions of the image file that will be created. If you want it to be full width then that's the job of your CSS and markup. You also need to consider that add_image_size() cannot make images bigger in any dimension. It will only crop and resize down. – Jacob Peattie May 6 '18 at 14:18
  • @NagaRaj, will you edit your comment. The question is not available in your link. – Suresh Sapkota May 12 '18 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.