• charlene2021

    (@charlene2021)


    Have an image in my themes image folder I want to put on my blog. What is the php shortcut to do it instead of having to put the full image url

Viewing 3 replies - 1 through 3 (of 3 total)
  • Jeremy Clark

    (@jeremyclark13)

    Like this
    <img src="<?php bloginfo('template_directory') ?>/images/yourimage.jpg" alt"" />

    Thread Starter charlene2021

    (@charlene2021)

    thanks very much

    moshu

    (@moshu)

    The “shortcut” will put the full URL…
    It is here:
    Template_Tags/bloginfo#Parameters
    e.g. <img src="<?php bloginfo('stylesheet_directory'); ?>/images/your-pic.gif" alt="" />

    Note. Somebody added the “deprecated in 2.3.1” notice… but, actually, it works on my 2.3.3, and couldn’t find any documentation about being deprecated.

    Edit. OK, I was spending time to find info about deprecation…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘php shortcut to link to image’ is closed to new replies.