• Resolved snackd

    (@snackd)


    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

    (@esmi)

    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

    (@snackd)

    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.