Title: echo issue with WP function [Help]
Last modified: August 22, 2016

---

# echo issue with WP function [Help]

 *  Resolved [Amit Biswas](https://wordpress.org/support/users/amitbiswas06/)
 * (@amitbiswas06)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/echo-issue-with-wp-function-help-1/)
 * 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 1 replies (of 1 total)

 *  Thread Starter [Amit Biswas](https://wordpress.org/support/users/amitbiswas06/)
 * (@amitbiswas06)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/echo-issue-with-wp-function-help-1/#post-5612227)
 * I need to use `get_bloginfo` to return a string which you can concatenate, bloginfo
   echo’s automatically (in this case, while the echo string is being constructed,
   thus being echoed before the rest of the string). [Alexander helped me in this issue here](http://stackoverflow.com/questions/27659562/echo-issue-with-wp-function/27659584#27659584).

Viewing 1 replies (of 1 total)

The topic ‘echo issue with WP function [Help]’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Amit Biswas](https://wordpress.org/support/users/amitbiswas06/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/echo-issue-with-wp-function-help-1/#post-5612227)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
