0

I would like to resize image in my wordpress template using url parameter. Best example for this would be Wordpress's very own twenty Twelve theme.

Following is link to image with width parameter in the end. If you change width to 50 it'll return image with 50px width.

https://twentytwelvedemo.files.wordpress.com/2012/03/wheat-field.jpg?w=500

I'm confused if its server setting or we can do it using php.

Thanks.

1

WordPress(.org) doesn't have anything like this built into the core. A lot of theme developers use Timthumb to achieve that. The example you've linked to is on a wordpress.com server so there will be something custom going on for that functionality.

You could also look at the WordPress functions add_image_size & the_post_thumbnail.

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.