• Resolved Sparky1337

    (@sparky1337)


    Ok so my experience in WordPress is limited but I am learning. I took over a website for a job and therefore most of this website I have not done so I don’t know how everything has been done. Although I think I have figured most of it out for now.

    That being said my question is that I am hard coding a picture to be linked in a footer of the pages that acts as a hyperlink to another website. (Like those little ads at the bottom.) For businesses that we associate with and everything. While I have gotten the picture link to do exactly what I want, and it is placed where I want, the actual picture itself does not display. It looks like a broken link for the picture.

    Now I have uploaded the picture that I am using on the media library, and tried to use it that way. I did not upload it via FTP like is mentioned numerous times but I figured since I uploaded it directly that it should be fine. I might be wrong but this is why I am asking the question here.

    Here is the little snippet of code from the footer.php file:

    <a href = "https://www.virginiapeninsulachamber.com/" target="_blank"> <img src="<?php bloginfo('template_url'); ?>/images/Peninsula_Chamber_of_Commerce.png" alt="Virginia Peninsula Chamber of Commerce" />

    Now there are multiple images like this and I was just adding another one on to it. I mostly just copied the previous pictures code, and this led me to believe that I have not fully uploaded it to the server for WordPress to use.

    The full site is here for you to look at https://www.macpaint.net

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • uploaded the picture that I am using on the media library

    what is the image url?

    this should possibly have a structure like https://www.macpaint.net/wp-content/uploads/2014/03/Peninsula_Chamber_of_Commerce.png

    to target that, try (untested):

    <img src="<?php $upload_dir = wp_upload_dir(); echo $upload_dir['baseurl']; ?>/2014/03/Peninsula_Chamber_of_Commerce.png" alt="Virginia Peninsula Chamber of Commerce" />

    https://codex.www.ads-software.com/Function_Reference/wp_upload_dir

    in your code, you are aiming at a location within your theme’s /images/ folder to which you possibly need to upload the image using FTP.

    Thread Starter Sparky1337

    (@sparky1337)

    This is the short link, that is given: https://www.macpaint.net/?p=2474

    Although I guess I am a little confused with the directory path as there are some images at the bottom that are like this:
    <a href = "https://www.duron.com" target="_blank"> <img src="<?php bloginfo('template_url'); ?>/images/duron_logo.png" alt="Duron" />

    And that is what I am trying to re-create. As I haven’t the slightest idea on how to access the template’s images folder, I figured that this was just going through the media library. But from my look through it that doesn’t seem to be the case. And thank you for the reply, the help is appreciated.

    Thread Starter Sparky1337

    (@sparky1337)

    Ok well I finally was able to get into the wp-contents folder of the website. Not knowing what I’m doing half the time makes life a little confusing. So I have transferred the image to the images folder, yet it still does not display. I guess I must have it set wrong in the footer code.

    Thread Starter Sparky1337

    (@sparky1337)

    Oh well I finally figured it out. There were apparently three images folder under the same directory. Guess I also have some cleaning up to do. Thanks alchymyth!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Image for footer not showing but hyperlink works.’ is closed to new replies.