Title: Template tag help
Last modified: August 19, 2016

---

# Template tag help

 *  [turbolemonjames](https://wordpress.org/support/users/turbolemonjames/)
 * (@turbolemonjames)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/template-tag-help-1/)
 * Hi, I’m using the following code within the single.php template page.
 * My issue is I can’t use the template tag within the echo statement, is there 
   a way around this so that the template tag works instead of hard coding the url
   cheers.
 *     ```
       <?
       if (in_category('3203')) { echo('
       <div>
       <img src="<?php bloginfo('template_url'); ?>/images/banner1.jpg" />
       </div>
       '); }
       elseif (in_category('3204')) {
       echo('
       <div>
       <img src="<?php bloginfo('template_url'); ?>/images/banner2.jpg" />
       </div>
       '); }
       elseif (in_category('3205')) { echo('
       <div>
       <img src="<?php bloginfo('template_url'); ?>/images/banner3.jpg" />
       </div>
       '); }
       ?>
       ```
   
 * Any help welcome, cheers

The topic ‘Template tag help’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [turbolemonjames](https://wordpress.org/support/users/turbolemonjames/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/template-tag-help-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
