WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding echo in betwenn (5 posts)

  1. fatty123
    Member
    Posted 1 year ago #

    Does it make any difference if you add/omit the word echo?

    e.g. <?php bloginfo('template_url'); ?>
    e.g. <?php echo bloginfo('template_url'); ?>

    which is correct?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    <?php bloginfo('template_url'); ?>

    It is echoed to the screen by the bloginfo() function itself.

  3. fatty123
    Member
    Posted 1 year ago #

    then how about template directory?:
    <?php echo bloginfo('template_directory'); ?>

    is it correct or wrong? the reason I'm asking is because I saw an online tutorial where the person add echo for all his blog info to refer to his image source.
    <img src="<?php echo bloginfo('template_directory');...... ?>">

    Yet he preview in browser and everything works fine. So I just wondering if it is the same thing or not ><

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Use <?php bloginfo('template_directory'); ?>. The tutorial you saw is wrong.

  5. fatty123
    Member
    Posted 1 year ago #

    Thanks =)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags