WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding an image in Widget area or sidebar? (8 posts)

  1. Paint Guy
    Member
    Posted 4 years ago #

    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?

  2. Paint Guy
    Member
    Posted 4 years ago #

    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.

  3. vtxyzzy
    Member
    Posted 4 years ago #

    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 />

  4. Paint Guy
    Member
    Posted 4 years ago #

    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?

  5. vtxyzzy
    Member
    Posted 4 years ago #

    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.

  6. Paint Guy
    Member
    Posted 4 years ago #

    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?

  7. vtxyzzy
    Member
    Posted 4 years ago #

    Yes, you can do that.

    If this completes your request, please mark this topic 'Resolved'.

  8. Paint Guy
    Member
    Posted 4 years ago #

    Thanks vtxyzzy and a Happy New Year to you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.