链接到 CSS 样式表
我的 WordPress 主题选项面板中有一个选项,可以从五种不同的样式中进行选择。在本地主机上运行 Wordpress,如果我选择黄色、红色、绿色、蓝色或黑色,则样式将正确应用并且一切正常。我在 header.php
中使用的代码是这样的:
<link rel="stylesheet" type="text/css" media="screen"
href="<?php bloginfo('template_directory'); ?>/css/<?php echo get_option('of_cssstyles'); ?>.css" />
但是当我在网络上安装相同的主题时,我得到一个完全没有 CSS 样式的网页,你可以在这里看到它:(http://macoverflow.org/p3dra/),如您所见,没有应用 CSS 样式。
如何解决这个问题?
I have a option in my Wordpress theme options panel that I made to choose from five different styles. Running Wordpress on localhost if I choose yellow, red, green, blue or black the style is applied correctly and everything works fine. The code I'm using in header.php
is this:
<link rel="stylesheet" type="text/css" media="screen"
href="<?php bloginfo('template_directory'); ?>/css/<?php echo get_option('of_cssstyles'); ?>.css" />
But when I install the same theme on the web I get a webpage with absolutly no CSS style, you can see it here: (http://macoverflow.org/p3dra/), as you can see no CSS style is beeing applied.
How to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您链接到的样式表不存在。您需要将其上传到服务器或链接到其上传的位置。
编辑:转到: http://macoverflow.org/p3dra/wp-content /themes/blankfolio/css/ 显示样式表实际上称为“yellow.css”,但您链接到的页面是“Yellow.css”,请注意以下情况“是”。
The stylesheet you are linking to doesn't exist. You need to upload it to the server or link to somewhere it is uploaded.
edit: going to: http://macoverflow.org/p3dra/wp-content/themes/blankfolio/css/ shows that the stylesheet is actually called "yellow.css", but the page you are linking to is "Yellow.css" note the case of the "y".
您是否将样式表上传到服务器?
您是否将样式表的权限设置为可由 apache 读取?
通过查看完成页面中的最终 html 代码,我收到以下内容:
http://macoverflow.org/p3dra/wp-content/themes/blankfolio/css/Yellow.css
找不到这个。
Did you upload your stylesheets to the server?
Did you set the permissions on the stylesheet to be readable by apache?
I received the following by looking at the final html codein the finished page:
http://macoverflow.org/p3dra/wp-content/themes/blankfolio/css/Yellow.css
This is not found.
他的意思是文件名是区分大小写的,所以 Yellow.css 和 Yellow.css 在 apache 眼中是两个不同的文件,它们的不同就像一个叫 Yellow.css 而另一个叫 Pink.css ,细节在第一个字母中,是大写的。
whats he is saying is the file name is caase sensitive so Yellow.css and yellow.css are two different files in the eyes of the apache, they are as different as having one called yellow.css and he other called pink.css , the detail is in the first letter, being a capital.