Support » Fixing WordPress » Adding an image in Widget area or sidebar?

  • Resolved Paint Guy

    (@paint-guy)


    How can I add an image into my sidebar where the Widgets are located? Is there a way to do this? I am not a coder but is there some code or an image widget I can add?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Paint Guy

    (@paint-guy)

    I need help with this please!!! I want to add an image to the sidebar of my blog.

    Currently there are no images there, but only my (recent posts, categories, archives etc) so I want to know if I can just add some code to the CSS and where it should go or do I need to add some code to the “sidebar.php” too for example.

    If someone could help me get this working I would really appreciate it.

    You can use the Text Widget supplied with WP to display a picture in the sidebar if your theme is widget-enabled.

    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.

    You may need to use the height and width attributes to size the image. You should end up with something like this:

    <img src="http://mysite.com/wp-content/uploads/2009/12/MyPicFile.jpg" width=200 height=120 />

    Thread Starter Paint Guy

    (@paint-guy)

    vtxyzzy, thanks for the quick reply, yes the theme is widget enabled, but I have another question which arose from your answer.

    Where to Store a Sidebar Image?
    I want images I use in my blog, (like a sidebar image), to open up in a new theme if my theme is changed. How would I do this, because if I put my sidebar image in my current themes “images” folder, then if I change my theme my images most likely won’t show up in my new theme if they were in my last themes “images” folder.

    I hope this makes sense. Should I create a new folder named “IMAGES” somewhere outside of my “Themes” folder or someplace else. How do other people do this and what is the best method?

    Look at the URL above. It does not depend on a theme, only the wp-content/uploads/… folder.

    Admin->Media->Add new places images there by default, not in a theme folder.

    One other note; if you use width=’100%’ (with no height=), the image will adjust to the width of your sidebar, even if it is different on a new theme.

    Thread Starter Paint Guy

    (@paint-guy)

    Thanks vtxyzzy, so if I understand you correctly, WordPress will place the image into a folder for me if I select Admin->Media->Add New and upload the image.

    One other note; if you use width=’100%’ (with no height=), the image will adjust to the width of your sidebar, even if it is different on a new theme.
    Thanks for the tip!

    One other thing. If I want to manually upload an image can I just place it in the “wp-content/uploads” folder under the correct date and then link to it?

    Yes, you can do that.

    If this completes your request, please mark this topic ‘Resolved’.

    Thread Starter Paint Guy

    (@paint-guy)

    Thanks vtxyzzy and a Happy New Year to you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding an image in Widget area or sidebar?’ is closed to new replies.