688 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more

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).


2468 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes