WordPress.org

Ready to get started?Download WordPress

Forums

Problem with images referenced in HTML (3 posts)

  1. rocketspops
    Member
    Posted 5 years ago #

    Hello,

    I am busy assembling my own wordpress theme, but for some reason I cannot get the images I reference in HTML to show up in the browser. My CSS background images show up nicely, but if I go to insert an image in the HTML like: <div> <img src="suchandsuch.jpg" alt="suchandsuch" </div> I only get the alt text displayed in the browser.

    Any ideas?

    Thanks!

  2. haochi
    Member
    Posted 5 years ago #

    Sounds like you are calling an image that DOESN'T exist. Try with absolute URL.

  3. iridiax
    Member
    Posted 5 years ago #

    Yes, absolute URLs are the easiest in this situation. If you are putting images in your template files, and the images themselves are in that template's images folder, you can use this:

    <img src="<?php bloginfo('template_url'); ?>/images/my-image.gif" />

    http://codex.wordpress.org/Bloginfo

Topic Closed

This topic has been closed to new replies.

About this Topic