[resolved] I can't get HTML to display an image in header of my local host site (3 posts)

  1. ContraCosta
    Posted 5 years ago #

    I am trying to customize my theme with social icons on my local host.
    But no matter what path I give the img src no image displays in the heading (I also tried to upload different images through html code across the site with no success). I am using MAMP. The images are located in my local host folder under wp-content/themes/theme/images

    I wrote this in the CSS:

    .custom #social-icons a img {
    float: right;
    margin-left: 0.3em;

    and this in the header.php:

    <div id="social-icons">
    <a href="http://www.facebook.com"><img src="images/facebook_icon.png" width="32" height="32" alt="Facebook" /></a>

    I appreciate the help. Thank You!

  2. Michael
    Forum Moderator
    Posted 5 years ago #

    try and use an absolute image path;
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/facebook_icon.png" width="32" height="32" alt="Facebook" />

  3. ContraCosta
    Posted 5 years ago #

    Wow! That works well. So do you have to use PHP code when you want to add an image in a php document, or that just for local hosts? I'm confused because I thought you could use HTML...

    Anyway thanks a million.

Topic Closed

This topic has been closed to new replies.

About this Topic