How to Add an Image in WordPress Sidebar Widget

Do you want to add an image in WordPress sidebar widget? Sidebar Widget is one of the attractive parts of your website and adding an image in the sidebar means making your website more elegant and pleasant. To add an image in WordPress is quite easy, however, adding images outside your posts need to be done manually by adding the HTML code. But don’t worry! It is quite easy to add an image in WordPress sidebar widget even if you don’t have much knowledge about coding.

In this tutorial, we are going to show you how to easily add an image in WordPress Sidebar Widget without any plugins.

Manually Add an Image in WordPress Sidebar Widget

First of all, you need to upload the image that you want to see in your sidebar to your WordPress site. For that, go to Media > Add New and upload your image file like you normally would.

Click on the Edit link next to the image after that.

Edit Image

WordPress will now take you to the Edit Media page, where you will see the image file URL on the right side of the screen. Now, you need to copy this URL and paste it in the text editor like Notepad.

Copy URL of the image

Then, go to Appearance > Widgets screen and drag-drop a text widget to your sidebar where you want to display the image.Paste URL of image

In the text box area of the widget, you need to add your image using the following code:

<img src=”Paste The File URL Here” alt=”WordPress” />

The img tag is used in HTML to display images. It needs two attributes, the first one us src which defines the image file location. This is where you will paste the URL you copied earlier.

The second one is alt which is used to provide an alternate text for the image. Your final img tag will look something like this:

<img src=”http://devotepress.com/wp-content/uploads/2017/06/WordPress.jpg” alt=”WordPress” />

Now, click on the Save button to save your widget.

Preview of your website

That’s all there is. You can now visit your website and see the image displayed in your sidebar. It’s not that difficult, is it? Please leave us your comments.

 

Leave a Reply

Your email address will not be published. Required fields are marked *