WordPress: Display Images in Sidebar

July 30, 2012 / Updated: July 30, 2012 / Lena Shore
Filed under:

Question

I was looking for an image link plugin for widgets when I found your post on linking images, but I need advice on how to link images in widgets(using the html for the image). I found a title link plugin, but the only image link plugin I could find warns that it is out of date and may not work (did not try it).

This seems simple but beyond me (just above novice). I would appreciate any help.

Answer

You have a few choices depending upon how you want to approach this.

  • Find a widget that will display an image easily from your Media uploads. Try searching for “sidebar image” when looking.
  • Find a widget that works well with any gallery module you are using. For instance, NexGen gallery has a widget that will let you insert a photo.
  • Use the “Text” widget to add a piece of code to display the image.
To make that last one work you’ll need the code and the path to the image.

Here is the Code:

<a href=”LINK”><img name=”” src=”SOURCE” width=”32″ height=”” alt=”” /></a>

Path to image:

  • Upload a new image from the “Media” section of your website or click on an existing image from that library.
  • While viewing the image you will see a “File URL” which is the location of the uploaded file. Copy that code and replace the word SOURCE above with it.
  • Replace LINK with the path/page/url you want the image to link to.
  • Change the “width” to whatever you want the width of the image to be.
Your final code might look something like this:

<a href=”http://yourwebsite.com”><img name=”” src=”http://www.yourwebsite.com/wp-content/uploads/2012/07/image.png” width=”200″ height=”” alt=”” /></a>

Archives

Categories