Img Src on local computer

自作多情 提交于 2019-11-28 13:06:56

Generally IE is OK with a path like C:\, but other browsers need something more. Start the path with file:///C:/ and then fill in the rest of the path to the file through Windows Explorer.

But it might be best to consider relative paths - ../../images/src="img.gif" - for example. This would be two directories up from the current location, and then into the images directory.

You should add <?php bloginfo('template_url');?> in front of the actual path. Let's suppose that you have a logo.png image in a folder called images in your theme. To link it in a Wordpress theme (index.php or other wordpress template pages) you do something like this:

<img src="<?php bloginfo('template_url');?>/images/logo.png" alt="Logo"/>

The above php function (bloginfo) is calling for your template url. To this template url you need to add where the file actual file is in your theme (in this case /images/logo.png ).

Hopefully this makes sense.

Paths to files in HTML are from the web root. So \tutorials\wordpress\wp-content\themes\LeftColumn\images\pmsplogo.jpg is the same on your local computer and remote server. If it isn't working then you need to make sure your paths are correct and you have set up both servers correctly.

It is not necessary to write whole path in frame of template. This should suffice: \images\pmsplogo.jpg

Here's screen of my WordPress template, It's working very fine with entry described above:

If you were moving the template, you wouldn't need to change path of each img. It's big advantage.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!