Using the Media Library to Put a Picture in Your Sidebar

As you already know, the media library stores all the pictures
you use in your posts. You can also use it to store files you want
to use in some other way. For example, you can link to one of
your media files from an ordinary web page on a traditional,
non-WordPress website. All you need to do is take note of
the file’s URL. (To get that, choose Media→Library to visit
the media library, and then click the file you’re interested in.
WordPress displays the file’s location in the File URL text box.)
You can use the same trick to inject an image into the Text
widget (page 166), that all-purpose tool for showing scraps
of content outside your posts. As you learned in Chapter 5,
the Text widget accepts almost any HTML you can throw at it.
So if you know you have a picture in the media file with the
URL http://magicteahouse.net/wp-content/uploads/2014/06/
dead_elvis_tattoo.jpg, you can stick in an <img> tag like this:
<p>I’m a <b>hotshot tattoo artist</b>
living in the Bay Area. My work pushes the
bounds of taste and decency, just like you
know you want.</p>
<img src=”http://magicteahouse.net/wpcontent/
uploads/2014/06/dead_elvis_tattoo.
jpg”>
If you’ve been around the web block, you probably know that
it’s better to trim the picture link down to just /wp-content/
uploads/2014/06/dead_elvis_tattoo.jpg. It’s on the same site
as the rest of your WordPress content, so there’s no need to
include the domain name.

Advertisements
Using the Media Library to Put a Picture in Your Sidebar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s