I'm creating wordpress theme. and want to keep images static. i'm using img tags in my HTML <img src="assets/logo/logo.jpg">
. I just want to get the url of my image. i was trying <img src="../assets/logo/logo.jpg
">`
Assuming that your assets folder is in the template directory you could use bloginfo('template_directory');
like this <img src="<?php bloginfo('template_directory');?>/assets/logo/logo.jpg" alt="logo">
If you are outputting the template directory in a string e.g.
$output .= '<div class="listitem">';
$output .= '<img src="' . get_bloginfo("template_directory") . '/assets/images/property-not-found.png" />';
$output .= '</div>';
You need to use the get_bloginfo("template_directory")
Hope this answer will help anyone else who got stuck on this in the future.