Featured images are one of the most attractive points for your blog posts. If combined with a perfect headline, it can grab visual attention in a huge number of audiences to your blog post. Bloggers and blog writers are very choosy about setting the featured image for their blog post and every aspect about it.

In this article, I will guide you about how to set the size for your blog’s featured images by different methods. So let’s just stop wasting time and get started with productivity.

You can change featured image sizes with various methods depending upon your capabilities and interests with PHP or CSS. For an example, if you are a fully fledged PHP developer, you would like to add new image sizes to your blog with PHP code. If you are more of a designer than a developer, you would like to use Cascading style sheets more generally known as CSS which is used commonly to set style sheets for different WebPages of a website. I will guide you about setting featured image sizes with both of the methods.

Set Featured Image size using PHP

The professional way to set image sizes for developers is to do it by using PHP codes. The main thing to be remembered about using PHP is that you should make sure every syntax you are writing is correct and you are clear with its implementations because a wrong PHP code can get your website’s layout or backend in trouble.

Below is the syntax you can use to set the featured image size for your blog posts.

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

Add the above code to your functions.php file.

Note: Before using this code, make sure that the theme or WordPress version you are using is compatible with this. Though most of the versions will support this, you can always ask the support team of your host if there are any issues with the compatibility of this code.

Note: Do all the changes on the Child Themes so the changes you make remain saved even after any updates to your WordPress or theme.

Set Featured Image size using CSS in WordPress

If you are a designer you know what CSS can do with just some lines of code. You can change the display properties of the featured image of your blog post by editing its display code in the main class of the theme you are using.

Just like PHP, make sure that you understand every code you are editing or writing or you might end up crashing the design template of your website. You can set things like height, width, size of the featured image by using CSS. You can set the values in percentage also if you are not so thorough with the hex codes and pixel sizes for height, width and border colors for your featured image. But again, I must say “Play however you want to, but don’t break the design of your website while doing it”.


Above is an example of how you can set the width for a featured image. You can also set many different properties like height and size also by using CSS.

Note: Do all the changes on the Child Themes so the changes you make remain saved even after any updates to your WordPress or theme.

These were the ways by which you can edit different aspects about the featured image of your blog. You can also make changes to the featured image directly from your theme settings page; many themes support this feature by default.