I am using starkers naked theme to build a site in wordpress on the latest version of wordpress. I am a little confused. I have the homepage looking correct. I copied and pasted the code into the single.php and the page.php but a lot of the images are not showing up. The layout is there, the alt text for the images are there, but a lot of the nav images didn’t show up. They show up fine on the homepage, so why wouldn’t they here? any ideas?
I can help, if you will show me your wordpress blog.
Thats because you are probably loading the images with an img tag for example:
<img src="path to the image" alt="image" />
and that’s fine when you are in the root.
But when you navigate to a page your url is something like:
so your images path is no longer correct.
In order to fix this you should insert your images this way:
<img src="<?php echo bloginfo('template_directory');?>/images/image.gif" alt="" />
If the image resides in a subfolder of your theme’s folder called images.
Hope this explanation makes sense!
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author has had an Item Featured
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 5-6 years
- Referred between 50 and 99 users
- Sold between 10 000 and 50 000 dollars
If you’re including images through HTML in your template, you must include:
<?php bloginfo(‘template_directory’#); ?>
at the beginning of image path. (remove the #)
Edit: Nevermind, see Tonyc’s post above.
thanks guys. I thought there might have been another way. I added the code to my images and they are working now.