WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding linked images to sidebar? (4 posts)

  1. raine.
    Member
    Posted 5 years ago #

    If you look at a screenshot of the site I'm working on, it has a column with Google ads in it:

    http://img501.imageshack.us/img501/1429/sampleks1.gif

    I've found the code for this in sidebar.php. What I want to do is remove the ads and in its place have a column of simple .gifs or .jpg logos. I've tried using 'img src=' but all I get is the 'alt' text displayed in the sidebar:

    http://img174.imageshack.us/img174/6663/sample2yh1.gif

    ...what I am trying to do is something more like this (using WordPress logo as an example):

    http://img509.imageshack.us/img509/1972/sample3cs9.gif

    ...where each logo is an image file, and (hopefully) clickable to follow a link. How would I do this? I'm pretty decent at .html and it seems to work in .php but I can't figure this out on WordPress, and I've been trying different "solutions" I've found online for the last few days, to no avail.

  2. raine.
    Member
    Posted 5 years ago #

    Using the latest version of wordpress FYI

  3. Dunkkan
    Member
    Posted 5 years ago #

    Hi raine,

    What I'd do is to work directly in the html, like you said.

    First, go to the .php file where you want to place your images : the sidebar, or index.php.

    Then, try to write a simple html call :

    <div>
    <img src="http://www.yourdomain.com/directorywhereWPis/images/image1.jpg" width="200" height="150">
    </div>

    You can add some class or id here, reflected in your CSS file, for exemple:

    <div id="logos">
    <img src="http://www.yourdomain.com/directorywhereWPis/images/image1.jpg" width="200" height="150">
    </div>

    and then in style.css:

    #logos {margin-left: 15px;}

    Width and height will be relatives to the size of your .jpg, obviously. You can even set them in auto.

    Making the links:

    <div id="logos">
    <a href="SOMEURL" ><img src="http://www.yourdomain.com/directorywhereWPis/images/image1.jpg" width="200" height="150"></a>
    </div>

    You can place also the images between the images your theme provides, or in the folder where WordPress stock the files uploaded with the Media Manager in the Post's Editor. Just try to get the correct path in src="".

    If something goes wrong, try to place your folder with the images somewhere else, in the root directory is a good place.

  4. raine.
    Member
    Posted 5 years ago #

    I think it was folder location for the images, I moved the folder to the root directory and now it's working perfect. I had a feeling it wasn't as complicated as I thought, thank you for the walkthrough =)

Topic Closed

This topic has been closed to new replies.

About this Topic