We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials

More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsWordPressWordPress Administration

How to Change Default Size of Featured Image in a Post

Ubuntu VPS
Follow These Steps to Change Default Size of Featured Image in a Post

Before changing default size we need to make sure you have at least one post with featured image. Featured image can be added in WordPress dashboard by going to Posts and click on already created post name. It should open post editing page where we should found “Feature Image” block in the right lower corner.

WordPress Featured Image

To add featured image click on where it says “Set featured image” which will open image select window. Find the image you want to use in the post and click “Set featured image” again. After that we should see newly added featured image.

WordPress New Featured Image

From now we assume that featured image is added. But from the post editing page you can not change its size. By doing a simple modification to WordPress theme functions file you can adjust default size of featured image in a post. In order to do this you will need to open WordPress installation directory by using built in file manager in the hosting account control panel or FTP client like FileZilla. Browse to WordPress installation directory and navigate to wp-content>themes>[current theme name]. There you should find functions.php file which you will be editing.

WordPress Functions File

Open file functions.php for editing and locate the line that says

1
set_post_thumbnail_size( 50, 50 ); // Unlimited height, soft crop

Change the values as needed and save the file for changes to take effect. Then go to the post with featured image added and check its size, it should be changed according to the provided values in the functions.php file.

OpenVZ VPS
Rate this Tutorial:
One Comment Leave a Comment
  1. Vishal dogra

    Thanks sir for your Great help !!!!

    Reply
Leave a Comment

Other (182)

Popular Keywords