- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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”:
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?
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?
If you’re using it in a template you need to include the path to the theme folder:
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!
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?