1

While uploading featured images, the problem I am getting is, all images are shrinking automatically.

I want to retain the original image. Check this example. All staff memebers images are shrinked automatically but in featured images I have uploaded a full image of staff members.

I thought that images are too large so that wordpress is automatically shrinking the images, so, I have scaled and cropped the images in media library. Some of the images got fix but some remains the problem.

Is there a way that the orignial uploaded image will be shown as it is?

3
  • If you want your theme to show full size image then you will have to change thumbnail size in theme file. Search which theme file this page uses and replace thumbnail id with full.
    – Robert hue
    Commented Dec 22, 2014 at 9:25
  • @Roberthue in upload folder there are various copies of same image present with different size. wordpress is picking the image with 242x180 size..how to change this?
    – james
    Commented Dec 22, 2014 at 9:41
  • All different image sizes generated in upload folder are defined in functions.php file but to use different image thumbnail in website, you will have to change in theme file. Search which theme file this page uses and replace thumbnail id with full or whatever you prefer.
    – Robert hue
    Commented Dec 22, 2014 at 9:49

1 Answer 1

2

Hey if you want to add custom image size then add the following code in your function.php file

add_image_size( 'thumb', 220, 180, true );

and then call featured image in your template like this

<?php 
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail('thumb');
} 
?>

i think it will help you

9
  • Thanks for your answer but in upload folder there are various copies of same image present with different size. wordpress is picking the image with 242x180 size..how to change this?
    – james
    Commented Dec 22, 2014 at 9:42
  • By default when upload any image by using media uploader in WordPress it create three different size like thumbnail(default 150px x 150px max), medium(default 300px x 300px max), large(default 640px x 640px max) and full is original image size. Commented Dec 22, 2014 at 9:47
  • if you want to access custom size then follow above code Commented Dec 22, 2014 at 9:48
  • Where to add second part of your code?
    – james
    Commented Dec 22, 2014 at 9:52
  • second part of code add in your template file like content.php or in your custom template where you echo the post content like the_content Commented Dec 22, 2014 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.