简体   繁体   English

WordPress样式表和其他文件未链接

[英]Wordpress stylesheets and other files not linking up

I've uploaded a clients wordpress site to a test domain: 101share.co.uk . 我已经将一个客户的wordpress网站上传到一个测试域:101share.co.uk。 I had everything working on localhost and changed the urls and stuff before uploading, from http:// localhost/wincheapguesthouse/ to http://101share.co.uk . 我在localhost上进行了所有工作,并在上传之前更改了网址和内容,从http:// localhost / wincheapguesthouse /到http://101share.co.uk

After uploading and importing the database the result I get seems to be that many files are not being found, but they are there. 在上传并导入数据库后,我得到的结果似乎是找不到许多文件,但它们在那里。 In the source code if I look for , it can't find it. 如果我在源代码中寻找,则找不到它。 But if I look for or " http://101share.co.uk/wp-content/themes/retlehs-roots-16aad54/assets/css/app.css " Then I'm able to find it. 但是,如果我寻找或“ http://101share.co.uk/wp-content/themes/retlehs-roots-16aad54/assets/css/app.css ”,那么我就能找到它。

Have I got something wrong with the data base or is there a url I need to change, I can't change each link because I don't know exactly how much it is effecting. 我的数据库有问题吗?是否有需要更改的URL,我无法更改每个链接,因为我不知道它到底在影响多少。

I stressing out a little over this because it's a clients site and I need to get things working for them to see. 我对此略加强调,因为它是一个客户网站,我需要让他们看到一些有用的东西。 So any help would be very much appreciated. 因此,任何帮助将不胜感激。

Unless I'm missing something, on your page your CSS etc seems to start "/plugins..." for instance although should be "/wp-content/plugins..."? 除非我丢失了某些内容,否则在您的页面上您的CSS等似乎以“ / plugins ...”开头,尽管应该是“ / wp-content / plugins ...”?

Although, the ones starting "/assets" don't seem to exist no matter what I try. 虽然,无论我尝试什么,以“ / assets”开头的命令似乎都不存在。

I suggest looking over your folder structure and adjusting your links accordingly in (most likely) the header.php for that theme. 我建议查看您的文件夹结构,并在(很可能是)该主题的header.php中相应地调整链接。

I found the problem. 我发现了问题。 It's that the roots theme tries to rewrite your urls in a way that Apache doesn't agree with. 根本原因是root主题试图以Apache不认同的方式重写您的url。

If you comment out these lines under "config.php" it will work. 如果在“ config.php”下注释掉这些行,它将起作用。

add_theme_support('root-relative-urls');    // Enable relative URLs
add_theme_support('rewrites');              // Enable URL rewrites

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM