1
votes

I have the following Worpress theme (http://alethemes.com/socha/) and I am trying to insert a Footer image into it. I have tried the following code in the Appearance -> Editor -> footer.php but all that happens is the text in the alt="Image Description" is displayed in the footer section - no image. For the image source I have uploaded the image to Wordpress and I have copied the images link URL as defined in Media -> Media Library. The URL in the code below is just an example of the URL and not the actual URL.

</div>
<footer id="footer-main" role="contentinfo">
    <?php if (ale_get_option('copyrights')) : ?>
        <p class="copy"><?php echo ale_option('copyrights'); ?></p>

        <!-- My Footer Image Here -->
        <img src="http://mydomain.com/myimagefolder/image.format" alt="Image Description">

    <?php else: ?>
        <p class="copy">&copy; <?php _e('2013. Socha Responsive Theme. ALL RIGHTS RESERVED.', 'aletheme')?></p>
    <?php endif; ?>
    <div class="topbutton">
        <a href="#top" id="gotop"><?php _e('TOP', 'aletheme')?></a>
    </div>
    <div class="cf"></div>
</footer>
<?php wp_footer(); ?>

</body>

I have also tried inserting the code above in Appearance -> Theme Options -> Themes -> Copyright but again all that is dipslayed is the text in the alt="Image Description".

Can anyone tell me how I can insert the footer image?

1
Maybe try with <img src="http://mydomain.com/myimagefolder/image.format" alt="Image Description"/> ? Seems like there's a dash missingKimberley Furson
Tried that but does not work either. Still get the same results as described above. Only the text in alt="" is displayedheyred

1 Answers

4
votes

Wordpress can't find your image. Is this definitely the location of your uploaded image? If you uploaded via the WP uploader, it will be in the 'uploads' directory.

Try using;

<img src="<?php echo get_template_directory_uri(); ?>/myimagefolder/image.format" />

Using Wordpress's built in get_template_directory() function will make sure that if the URL changes, Wordpress will find the image.

Also, make sure to put the image width and height attributes into the tag.