tylerjay
Member
Posted 2 years ago #
I'm a building my theme's homepage. I have images/graphics within the php like this "<img src="img/featuredcalendar.jpg" width="280" height="33" />"
however they won't display. Background images are loading fine.
Is there a reason for this? Is the only way around to use background images?
motivatebusiness
Member
Posted 2 years ago #
You need to call the images using: <img src="<?php bloginfo(stylesheet_directory); ?>/img/featuredcalendar.jpg" width="280" height="33" /> -
probably because your img src is in a "relative path" format, meaning it is looking for images in the img folder, relative to the path you are currently browsing.
Try doing this:
<img src="<?php echo bloginfo('stylesheet_directory'); ?>/img/featuredcalendar.jpg" width="280" height="33" />
tylerjay
Member
Posted 2 years ago #
That did it. Thank you sir!
helenspacegirl
Member
Posted 2 years ago #
good tip, have to remember this