echo issue with WP function
-
Dear friends,
I am new WP user and please forgive me for any mistakes when explaining my issue.
I am having an issue with “echo”. Here is the situation –
<?php echo '<p><img src="' . bloginfo('stylesheet_directory') . '/images/img-1.jpg" /></p>' ?>When I am trying this, the output is totally different. The url is displaying outside the
<p>tag.Like this –
http://127.0.0.1/wp/wp-content/themes/ThemeName<p><img src="/images/img-1.jpg" /></p>But simple use like this – is working great. Why the above is not working? –
<figure><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img-1.jpg" /></figure>I really don’t know how to fix it. Please help me anyone.
Thanks!
-Amit
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘echo issue with WP function’ is closed to new replies.