html, url, http, php, widgets and all of that

In an attempt to improve the look of my blog, I decided to put a map on the sidebar. That should be easy, right?

Many thanks to Steve and Mona Liza for allowing me to pinch the idea, a photo of the map on the side of the RV, off their most excellent site The Lowe’s RV Adventures.

I’ve got a map too, I thought. I can do that. Several aborted attempts with the gallery widget and image widget produced nothing.

Mona Liza offered her help but not wanting to look the complete IT dunce, I thought I would try Googling how do I put a photo on the sidebar of my wordpress blog.

Well thanks to the helpful bods in the support forum for this but for the sake of your sanity please don’t bother to read any of the following in red. Skip to black.

Basically, in your functions.php file put in this:

function postimage() {
 // get the post meta info
  $key = "postimage";
  $id = get_the_ID();
  $custom = get_post_meta($id, $key, true);
  echo $custom;

Then in your sidebar.php file (or within a widget that you can enter in PHP code), put in:

$image = new WP_query ('showposts=1');
if(have_posts()) : while($image->have_posts()) : $image->the_post; ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php postimage(); ?></a>

<?php endwhile; endif; rewind_posts; ?>

where you want the image to appear.

There is absolutely no chance of me following any of that. Could you?

Then some clever lateral thinker called hhsleep, who is perhaps as programming-code-challenged as I am,  posted this easy solution:

“I figured it out.  Pretend you are doing a post.  Upload the image you want.  Then insert it in your post.  Copy the code and insert it in your text widget.”

Well thanks a bunch hh. That didn’t work either.

Then vtxyzzy posted:

First go to Admin->Media->Add New and upload the image you want. Once it is uploaded, click in the File URL box, hit CTRL-A CTRL-C to select and copy the URL.

Then go to Appearance->Widgets and drag the text widget into the sidebar.  In the text area, enter ‘<img src=”‘, then CTRL-V to paste in the URL of your picture. Type ‘” />’ to close the img tag. Click Save.

Sounded doable. Not too much code. Didn’t work. Not for me anyway.

Every post suggested using the text widget. Why would you do that when there is an image widget? C’mon. Tell me.

I had tried the image widget but discovered I was using the wrong url after having put the correct url in the text widget and just getting text.

Eventually I put the correct url in the image widget having spent HOURS on it. Or maybe many, many, many more minutes than I wanted to trying to put this map on the sidebar:

How did we miss that one?!!!
How did we miss that one?!!!

And who is going to appreciate all that effort? Nobody but me, but I think it looks amazing. Thank you again Mona Liza. I should have come to you first.

8 thoughts on “html, url, http, php, widgets and all of that

  1. I feel your pain. More than once I’ve called upon my oldest nephew, who works for a quasi-technology company, for help. He’s leaving for Thailand soon and plans to travel for at least six months. He has strict instructions to check in with me whenever (if ever) he’s at an internet cafe.


    1. You are so lucky to have IT support. I’m the IT tech in our household and everyone seems to find that hysterically funny. I muddle through. And talk to my computer a lot. Sometimes I say unkind things to it.


    1. I know you are just being kind, Carol, but thanks. I shouldn’t point this out but see the dirt above New England and the Lakes? I should have washed down the side of the trailer before I took the picture but it was 111 deg F!!! that day. I’ll wash it and take another picture . . . one day.


    1. Thanks, Barb. I stared helplessly at the first lot of code, made a pathetic stab at the second lot of code then started messing about until I got it right. That is my go to method for IT!


  2. Wow, your map looked better than ours. How did you miss Nebraska? And why 47 states? I dont understand that red texts either, that’s too much work.
    I just realized now this is the type of map you were referring to. But our sidebar map is a picture/an image of our decal which we update everytime we visit a state.
    And I pointed you to Google map 😦

    Thanks for the shout out we love it.


    1. I have a very dog-eared Cracker Barrel map of the U.S. that I have traced our meanderings on with different colored highlighter pens along with X’s and scribblings in black ink. I am now trying to match that to my diary entries and also a road atlas because the routes overlap at times and are almost indecipherable. Once I make sense of that I will have a go at a Google map. We didn’t deliberately miss Nebraska. We just didn’t deliberately go there either!


Please chat - put your two pennyworth in!

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

You are commenting using your 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 )

Connecting to %s