简体   繁体   中英

How to dynamically resize featured image in wordpress

In my website, Each page have different kinds of image overlays and i have set all the images in size respective to its HTML template.

Now my concern is that if the client wants to add an image as he wishes how to display the image in corresponding size without breaking the html design.

i have used the following code, but dosent seems to do any changes in the layout;

add_theme_support( 'post-thumbnails', array( 'testimonial' ) );
 add_image_size( 'testimonial-thumbnails', 60, 80, true );

Can anyone please shed some light on this

If you add a new image size then you'll need to regenerate all the WordPress thumbnails to create new images with the new dimensions in the upload folder.

https://wordpress.org/plugins/regenerate-thumbnails/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM