The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Can I NOT harcode domain name in IMG in Post? (3 posts)

  1. slobizman
    Posted 11 years ago #

    I do a lot of <img> statements in my blog posts. I'm hardcoding the domain name each time, like:

    img src="http://www.googletutor.com/wp-content/images/something.gif"

    I hate to think about all the changes I'd have to make if I ever changed my domain name. Is there some sort of code I can put in the page that signifies the site URL so I don't have to hard code it?

  2. Kiddeath91
    Posted 11 years ago #

    Just keep everything in the same directory (wp-content).

    Don't use the absolute URL. Do this:

    img src="/wp-content/images/something.gif"

  3. slobizman
    Posted 11 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.