Title: PHP noob question template directory T_STRING ERROR
Last modified: August 21, 2016

---

# PHP noob question template directory T_STRING ERROR

 *  Resolved [10k-design](https://wordpress.org/support/users/10k-design/)
 * (@10k-design)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-noob-question-template-directory-t_string-error/)
 * Hi all, I’m working on the Responsive theme, and I need to put some static image
   on the frontpage, this is the way the theme call it:
 * `$featured_content = '<img class="alignleft" src="path_goes_here" width="340px"
   height="100%" alt="" />'; ?>`
 * I’ve tried to use wp function **bloginfo(“template_directory”)** to refer to 
   the template path in some ways
 * src=”‘<?php bloginfo(“template_directory”); >’/images/img.png”
    src=”‘ bloginfo(“
   template_directory”) ‘/images/img.png”
 * but none of this works… also I’ve tried to define it in a variable and concatenate
   it in the src path with **echo** but neither this works…
 * anyone can plz help me?
 * thx in advance!

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-noob-question-template-directory-t_string-error/#post-4292018)
 * > src=”‘<?php bloginfo(“template_directory”); >’/images/img.png”
 * You need to close PHP with these characters:
 *     ```
       ?>
       ```
   
 *  Thread Starter [10k-design](https://wordpress.org/support/users/10k-design/)
 * (@10k-design)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-noob-question-template-directory-t_string-error/#post-4292038)
 * Thanks so much Andrew but doesn’t work, the problem for me is the double tag 
   <?php
 * `<?php $featured_content = '<img src="'<?php bloginfo("template_directory"); ?
   >'/images/img.png" />'; ?>`
 * this give me this error
 * `Parse error: syntax error, unexpected '?' in /web/htdocs/www.etc...`
 *  Thread Starter [10k-design](https://wordpress.org/support/users/10k-design/)
 * (@10k-design)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-noob-question-template-directory-t_string-error/#post-4292044)
 * this resolve my problem
 * `' . get_bloginfo("template_directory") . '`

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

The topic ‘PHP noob question template directory T_STRING ERROR’ is closed to new
replies.

## Tags

 * [template directory](https://wordpress.org/support/topic-tag/template-directory/)
 * [T_STRING](https://wordpress.org/support/topic-tag/t_string/)

 * 3 replies
 * 2 participants
 * Last reply from: [10k-design](https://wordpress.org/support/users/10k-design/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-noob-question-template-directory-t_string-error/#post-4292044)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
