I’m looking to return a template url rather than print it and bloginfo(‘template_url’);
prints… anyone know of a version of this function I can use inside of a string I’m building to print at a later point?
Example
$html = '<td style="width:40px;"><img src="';
$html .= bloginfo('template_url'); // <-- messes up string because it prints.
$html .= '/images/pause.png"></td>';
return $html;
I would recommend you use
get_template_directory_uri()
instead.Read more about the method here: Function Reference/get template directory uri, WordPress Codex
Use http://codex.wordpress.org/Function_Reference/get_bloginfo