Reputation: 1466
I'm creating a wordpress theme. and i want some of the images to remain static. how can i get the url behind my image source.
My Default Image URL
<img src="assets/logo/logo.jpg">
I was trying <img src="../assets/logo/logo.jpg">
Is there any function of wordpress that we can use to get the url of an image?
Upvotes: 3
Views: 2084
Reputation: 1383
You need to get the full path of the theme folder too you can do it like this
<img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/logo/logo.jpg">
Upvotes: 3