Reputation: 11295
$path = bloginfo('template_url');
$image_url = $path.'image.jpg';
I do not know why, but $path = bloginfo('stylesheet_directory');
is displaying url without echo
, any ideas where the problem is?
Upvotes: 1
Views: 79
Reputation: 2285
You must use template_directory
instead of template_url
<?php get_bloginfo('template_directory').'image.jpg'; ?>
Upvotes: 1
Reputation: 183
Bloginfo() always prints a result to the browser. If you need the values for use in PHP, try get_bloginfo() instead.
Upvotes: 1
Reputation: 12537
Yes bloginfo
automatically displays the property (while returning null). I think you want to use get_bloginfo
:
$path = get_bloginfo('stylesheet_directory');
$image_url = $path.'image.jpg';
Upvotes: 2