Title: Relative URL doesn’t work.
Last modified: August 18, 2016

---

# Relative URL doesn’t work.

 *  Resolved [jayjerome](https://wordpress.org/support/users/jayjerome/)
 * (@jayjerome)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/relative-url-doesnt-work/)
 * I’m calling an image into my sidebar (from sidebar.php) but have to use the full
   Absolute URL to make it appear.
    The relative URL address doesn’t seem to work.
 * The loooooonnnnnnngggggg Absolute address is :
    ‘<img src=”[http://localhost/wordpress/wp-content/themes/MistyLook/img/todaysspin.png&#8221](http://localhost/wordpress/wp-content/themes/MistyLook/img/todaysspin.png&#8221);
   alt=”Today’s Spin”>’
 * So far, I’ve tried all the following variations of the Relative HTML address,
   unsuccessfully:
    ‘<img src=”img/todaysspin.png”‘ ‘<img src=”/img/todaysspin.png”‘‘
   <img src=”./img/todaysspin.png”‘ ‘<img src=”../img/todaysspin.png”‘ ‘<img src
   =”mistylook/img/todaysspin.png”‘ ‘<img src=”/mistylook/img/todaysspin.png”‘
 * Am I missing a period or a comma or something?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [muelheim](https://wordpress.org/support/users/muelheim/)
 * (@muelheim)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/relative-url-doesnt-work/#post-484625)
 * If your page is in [http://localhost/wordpress/wp-content/themes/MistyLook/](http://localhost/wordpress/wp-content/themes/MistyLook/)
   
   <img src=”img/todaysspin.png”> should do it (did you forget the closing >)?
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/relative-url-doesnt-work/#post-484627)
 * The ‘relative’ address that might work is:
 * `<img src="wp-content/themes/MistyLook/img/todaysspin.png"`
 * The file path will be handled _relative_ to the current directory _one is at_;
   and by that I don’t mean the template file, but you and your web browser.
 * One way to handle this in templates is to use the [bloginfo()](http://codex.wordpress.org/Template_Tags/bloginfo)
   template tag like so:
 * `<img src="<?php bloginfo('template_dir'); ?>/img/todaysspin.png"`
 * This will produce an absolute url to the image, but dynamically (so you don’t
   need to edit it whenever you move things, etc.).
 *  Thread Starter [jayjerome](https://wordpress.org/support/users/jayjerome/)
 * (@jayjerome)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/relative-url-doesnt-work/#post-484636)
 * the ‘<img src=”wp-content/.. etc”> worked…
 * thanks for the help.
 * jj

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Relative URL doesn’t work.’ is closed to new replies.

## Tags

 * [failing](https://wordpress.org/support/topic-tag/failing/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 3 replies
 * 3 participants
 * Last reply from: [jayjerome](https://wordpress.org/support/users/jayjerome/)
 * Last activity: [19 years, 5 months ago](https://wordpress.org/support/topic/relative-url-doesnt-work/#post-484636)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
