Title: html in php &#8212; easy question about embedding code
Last modified: August 19, 2016

---

# html in php — easy question about embedding code

 *  Resolved [snackd](https://wordpress.org/support/users/snackd/)
 * (@snackd)
 * [17 years ago](https://wordpress.org/support/topic/html-in-php-easy-question-about-embedding-code/)
 * i’m trying to insert an image from somewhere in the header template. i tried 
   this first
 *     ```
       echo '<img src="' . bloginfo('template_directory') . '/../thematicChild/images/greenblue_line.gif" />';
       ```
   
 * but it rendered like this:
 *     ```
       http://www.blah.com/wp-content/themes/thematic<img src="/../thematicChild/images/greenblue_line.gif" />
       ```
   
 * do you see? it comes out in a different order than i wrote it.
    anyone know why
   this is???? i fixed easily it like this
 *     ```
       echo '<img src="';
       echo bloginfo('template_directory');
       echo '/../thematicChild/images/greenblue_line.gif" />';
       ```
   
 * but that just seems a little ghetto and inefficient.
 * suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [17 years ago](https://wordpress.org/support/topic/html-in-php-easy-question-about-embedding-code/#post-1086155)
 * `bloginfo()` always echoes by default, if I remember correctly. Try using `get_bloginfo('
   template_directory')` if you want to use the output in conjunction with `<?php
   echo`.
 *  Thread Starter [snackd](https://wordpress.org/support/users/snackd/)
 * (@snackd)
 * [17 years ago](https://wordpress.org/support/topic/html-in-php-easy-question-about-embedding-code/#post-1086168)
 * thanks esmi. tres elegant.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘html in php — easy question about embedding code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [snackd](https://wordpress.org/support/users/snackd/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/html-in-php-easy-question-about-embedding-code/#post-1086168)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
