Home > Backend Development > PHP Tutorial > wordpress 的主题中的页面有php和html,css和js的路径该如何统一写

wordpress 的主题中的页面有php和html,css和js的路径该如何统一写

WBOY
Release: 2016-06-13 12:25:35
Original
829 people have browsed it

wordpress 的主题中的页面有php和html,css和js的路径该怎么统一写?
 对于html页面是这么写的,这样直接打开页面html也可以用。
 <script></script> 

 对于php这样
 <script><br /><br /> 对于存在2种页面的情况下,如何写比较统一?<br><font color='#FF8000'>------解决思路----------------------<br>$PHP_SELF=$_SERVER['PHP_SELF'];<br /><br />$url='http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF,0,strrpos($PHP_SELF,'/')+1);<br /><br />echo $url;<br /><br /> <br />输出结果:http://localhost/<div class="clear"></script>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template