0

Im making my theme responsive and hence would like the images to have various sizes depending on device, resolution etc.

Normally i would just add make a add_image_size hook to image upload, however the theme im developing is already in use and the sizes needs to take effect for previous uploaded images aswel.

Is it possible to create the various image sizes ad-hoc? perhaps some hook i dont know about?

Best Regards, and thanks in advance

0

You could, but I wouldn't recommend doing it on the fly as it would take up unnecessary page resources each time the user loads the page. A better way to do it would put in the add_image_size hook you mentioned into the functions file, then install a plugin to regenerate thumbnails. https://wordpress.org/plugins/regenerate-thumbnails/ I've used this one in the past and worked very well. You should only have to install it, generate the thumbnails once, and then you can uninstall the plugin. The thumbnails should generate on each upload after that.

  • Thanks, that answers my questions and thanks for the plugin i had not found that :) – Tau Sand Mar 23 '15 at 17:16

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.