PHP Script Not Running in WordPress Correctly

主宰稳场 提交于 2019-12-02 18:02:56

问题


I recently converted http://usborrow.pizzli.com/apply to a WordPress Page Template for a site. Every other page came out fine, but when I go to http://usborrow.pizzli.com/?page_id=6, the page seems to lose all of its styling. Any support would be appreciated.


回答1:


Apparently there's an issue with the relative URL reference. Rather than referencing to the stylesheet with

<link href="../css/style.css" rel="stylesheet" type="text/css" />

Try absolute path instead

<link href="/css/style.css" rel="stylesheet" type="text/css" />

This should work on all pages, assuming that you store the stylesheet file inside the css folder within the site root folder. You should also do the same thing with the other CSS for IE

<!--[if lt IE 8]><link rel="stylesheet" type="text/css" href="/css/ie7below.css" /><![endif]-->

This way, no matter how deep the path the user is accessing (e.g http://usborrow.pizzli.com/folder1/folder2/folder3/file.abc) the CSS can be referenced without any problem.




回答2:


It would seem you should include /apply/style.css.



来源:https://stackoverflow.com/questions/10551489/php-script-not-running-in-wordpress-correctly

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