• 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.