ThemeForest

add_image_size

685 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Uruguay
  • Referred between 1 and 9 users
_rg_ says

Is there any way use this to create an image larger than the one uploaded?

I mean, let´s say you have this:

add_image_size('featured', 968, 309, true);

And the user uploads images smaller than 968 px width.

In this case, images will be less width than 968px, will take the original width value only, since the internal wp engine don´t resize the image more than the original (i guess).

Ideas?

2 years ago
1841 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Referred between 100 and 199 users
digitalimpact says

Well I guess specifying the width&height on the img tag is too ugly to use…

Maybe this gives you a starting point, if you know your PHP /WP well (I’m not that good, sorry I can’t add anything else but a link…)

Link: wp_expand_dimensions

2 years ago
by
by
by
by
by