• Hey guys

    At the moment i use bloginfo('template_directory');?>/img/mail.gif

    which of course works and outputs…
    src=”http://localhost/newsite/wp-content/themes/scotchegg/img/mail.gif”

    however here is the issue, i am want to test this from other machines on the network, and also a VM running IE6. In this case http://localhost will cause it to fail. So what I want is to get a pure relative link from index returned. so the output would be and used as..

    src=”wp-content/themes/scotchegg/img/mail.gif”

    Is there a WP function already to get this?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter scotchegg78

    (@scotchegg78)

    ive just played with editing general-template.php in WP core.

    added ..

    case 'rel_template_directory':
    		case 'rel_template_url':
    			$output = wp_make_link_relative(get_template_directory_uri());

    this is a solution i guess, but would of rathered there been something in WP as default moving forward, or even the option make links relative, absolute in the backend.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    If that’s part of a function (I have not looked yet) it might be safer to put that modification into your theme’s function.php file.

    Easier to keep your own functions up to date than mess with the core files.

    Edit: DOH, it’s bloginfo() just as you said already…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get theme relative link, not absolute (no http!)’ is closed to new replies.