• hi,

    I ‘ve got my wordpress site installed locally and what i want is to make an image work as a link to an “.html” type of file, which is located inside of a folder on my desktop. Could you please help me out?

    thank in advance.

    ps. i am giving you the path to this: C:\Users\My_user_name\Desktop\Folder_of_the_file\open_this.html

Viewing 3 replies - 1 through 3 (of 3 total)
  • This will not necessarily work as you expect.

    You can create a link from an image by editing the page/post in HTML mode, inside the <img tag you will add the “href=” phrase, probably something like: href="file://C:/Users/My_user_name/Desktop/Folder_of_the_file/open_this.html"
    However lets look at what this means. You are telling the browser where the image is being displayed, that clicking this image is to interpret the described href resource, your web server WILL NOT be invited to participate, the filesystem of the computer running the browser will be consulted, probably not what you intent, unless of course they are the same computer.
    The end result is that you need to make the file accessible to the web server, i.e. inside its file hierarchy.

    Thread Starter teolog

    (@teolog)

    i got a little confused..

    maybe, i can try this in a more simple way..no images as a a link, but, only a word as a link.

    also, where can i place this “.html” in my wordpress folders so that i can get this type of file working when i upload my content to my web host? Also, what is the code to make the connection from the text to the “.html”?

    i hope this is not so complicating to understand :/

    thanks in advance

    where can i place this “.html” in my wordpress folders

    It is IMHO best to leave WordPress to itself, don’t mix your own files in with it. So create a folder in the base directory of your website, say “/documents”, say your static HTML file were called “terms.html”, then in your website pages/posts/text widgets etc, in HTML mode you would put:
    <a href="/documents/terms.html">Terms and Conditions</a>

    I trust this is what you mean.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.html -> link to this’ is closed to new replies.