PHP Script Not Running in WordPress Correctly

2019-03-03 12:24发布

问题:

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.