Calling an image from the theme directory
-
How do I call an image that is my template directory?
The image is in my template directory in a folder called img.
I want to call the image from within a template file.
So far I have tried both get_template(), and get_template_directory(). The first doesn’t go far enough and just appends /template_directory to the url. The later goes too far back to all the way to my server root.
What’s more, I need to call it from within some existing php. Here’s the extract that’s not working for me.
echo '<div class="story-scroll-text"><p>Scroll down to continue<p></div><img src="'. get_template(). '/img/scrolldownicon.png">';
I’m pretty confused over what should be a super simple task
- The topic ‘Calling an image from the theme directory’ is closed to new replies.