Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress image display troubles

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33489
    pherankh
    Participant

    I’m a WordPress Newvbie and I’ve run into a head-scratching problem while in the middle of Chris’ “WordPress 3.0 Creating and Editing Custom Themes” tutorials.

    I’m in the middle of Chapter 3, and nothing I do can make the “home.php” image references display in the browser (only the Alt text shows up). Any image referred to by the “style.css” page (sitting at the same level as “home.php”) works fine. But “home.php” will not display images. I’ve swapped relative URLs back and forth between “home.php” and “style.css”, and the paths all work if placed in the CSS doc, but nothing displays when in “home.php”:
    Image of Super Sprocket 1000
    I’ve also tried using “/product-images/prod-supersprocket.png”, but that makes no difference. So can’t be an HTML code problem.

    Testing in the CSS page confirms that the images are there, and are correctly named. I’m thinking this is an Apache issue, but it could be a WP setting or bug as well. Any thoughts?

    #83234
    ivand
    Member

    can you please show us the html code?

    Also, home.php is inside a wordpress theme directory right? is wordpress installed in the root directory or a folder? whats the complete url of the image you’re referencing?

    #83223
    TheDoc
    Member

    If you’re using it in a template you need to include the path to the theme folder:

    #83218
    pherankh
    Participant

    Thanks, you both were on the right track.
    My Apache document root is htdocs, so, WordPress files are located there.

    But the actual WP document root is the “wp-content” directory.
    So to reach the images directory I had to use:
    wp-content/themes/WidgetCorp/images/

    TheDoc has given me the right PHP tag to use for this situation. Thanks!

    #83209
    pherankh
    Participant

    One related issue came up: what to do about WP Custom Fields that reference a URL? Doesn’t look like I can use the tag in the field. I have to use the long relative path in “wp-content”. What do people usually do here?

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Other’ is closed to new topics and replies.