Having a quotes issue, need a second pair of eyes!
echo "<img src='" . bloginfo('template_url') . "img/" . $f['mainImage'] . ".png' />";
Using the WordPress function bloginfo to get the theme path!
All i’m getting is the path printed out on the page, no image!
Thanks
What is output:
http://www.example.co.uk/wp-content/themes/example
<img src="/img/digital.png">
The function
bloginfo()
performs its own echo.http://codex.wordpress.org/Function_Reference/bloginfo
In your situation, you would use this code:
bloginfo()
is only used to directly output the requested value. Useget_bloginfo()
instead to work with the value before echo’ing it.As jnpcl has surmised, it looks like
bloginfo()
is print out the data for you.You’ve got two options:
get_bloginfo()
function, which wont just print it out but return it instead