• Resolved killertofu01

    (@killertofu01)


    Thanks for all the help in advance…

    I am trying to create templates in a test directory. In this template, I am trying to insert images into template pages, but they are listed in a directory in my WP root directory. For example, in my footer.php page, I am inserting an image located in my WP root directory: (.com/wp).

    My question is, is there a markup that I can use so that when I merge the new theme to a different WP installation, I don’t have to go back and change all the image links?

    Right now, all image links look like this:
    <img src="testsite.com/wp/images/image.jpg">
    But when I go and add the template to the live site, I end up having to change all the image links to:
    <img src="livesite.com/wp/images/image.jpg">

    I want to know if there is a way I can add something like the bloginfo tags so that all I have to do in my test site template is something like:
    <img src="<?php bloginfo('wpurl'); ?>/images/image.jpg">
    So that no matter where I put the template, it will always look to the WP directory for the images.

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter killertofu01

    (@killertofu01)

    Nevermind, figured it out for myself…

    Anyone wondering the same thing:

    <img src=”<?php bloginfo(‘url’);?>/wp/images/image.jpg”>

Viewing 1 replies (of 1 total)
  • The topic ‘Creating dynamic image links…’ is closed to new replies.