Add border and shadow to WordPress post images without plugin

I wanted to add a nice looking border and shadow to my WordPress images added within the post but did not want to add a plugin. Plugin has its own cost in terms of performance so I did not want to add a plugin for the sake of adding border and shadow to the images. Here is an extremely simple trick to add border and shadow only to your post images. If you change the theme, you may need to follow the same steps again but I think it is worth.

Login to your WordPress blog and go to Appearance > Customize.

Look for “Additional CSS” option and click on it

Add the following code in the box as shown in the image and click on “Save and Publish”.

Note: Depending on your theme, the featured image may or may not be affected by this css. If the featured image is affected and you don’t want the border and shadow, there is not a standard way to exclude the featured image. As the theme designers have coded featured image in different ways, you need to have a css programming skills in order to exclude featured image for your theme.

About Vishal Monpara

Vishal Monpara is a full stack Solution Developer/Architect with 13 years of experience primarily using Microsoft stack. He is currently working in Retail industry and moving 1's and 0's from geographically dispersed hard disks to geographically dispersed user leveraging geographically dispersed team members.

3 thoughts on “Add border and shadow to WordPress post images without plugin”

You need to look at the theme or WordPress theme documentation to find the exact css class name used for the post and add a border property to that css class definition. Definition can be stored at the place mentioned in this blog post.