I'm working on this site: http://west-valley-community-church.theportlandco.com/
And I'm trying to give the path to the theme to my images. I attempted using: get_stylesheet_directory and get_theme_root but neither of them are printing their path for some reason once prepend them to my image path.
Can someone furnish an example of an image using a "path to theme" function? I assume WordPress has this function built in already?
Thanks!
TheMacFeed
Member
Posted 2 years ago #
ClaytonJames
Member
Posted 2 years ago #
I'm trying to give the path to the theme to my images.
Is this of any use at all?
<?php bloginfo('template_directory'); ?>
Here is a reference: http://codex.wordpress.org/Bloginfo#Usage
If you're using paths to link to your images within the theme, this is the formatting you would use using your above example:
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/XYZ.png" alt="" title="" />
That's perfect. Thank you very much!
ClaytonJames
Member
Posted 2 years ago #