Add New thumbnail image sizes to WordPress theme

Add New thumbnail image sizes to WordPress theme, In WordPress by default after uploading an image in media uploader, the uploaded image will be cropped to three different sizes. These dimensions we have defined in Media Settings page.

If you want one more resolution, use the WordPress function add image size.

<?php add_image_size( $name, $width, $height, $crop ); ?>

Example to Add New thumbnail image sizes to WordPress theme

     add_image_size('1024x600', 1024, 600, true);
	add_image_size('1024x768', 1024, 768, true);
	add_image_size('1152x864', 1152, 864, true);
	add_image_size('1280x768', 1280, 768, true);

You are not allowed to use these names thumb, thumbnail, medium, large, post-thumbnail.

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe