Wordpress Production服务器上的CSS样式表无法加载

时间:2014-03-13 20:06:31

标签: css wordpress

您好我的WordPress网站遇到了一个奇怪的问题。我正在使用wp-bootstrap的子主题。当我将网站上传到我的共享主机时,似乎wordpress正在从我的本地主机上提取css。换句话说,网站加载到我的本地计算机上,但是,在任何其他计算机上,样式表都不起作用,页面看起来很乱。如果我查看来源,地址是:

<link rel="stylesheet" id="bootstrap-css" >>href="http://**localhost**/wordpress/wp_content/themes/wordpress-bootstrap-master/library/css/bootstrap.css?ver=1.0" type="text/css" media="all">

而不是:

<link rel="stylesheet" id="bootstrap-css" >>href="http://**www.mydomain.com**/wordpress/wp_content/themes/wordpress-bootstrap-master/library/css/bootstrap.css?ver=1.0" type="text/css" media="all">

有人知道这里可能会发生什么以及任何可能的修复吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

我会检查根目录中的styles.css文件。我的默认css文件如下所示:

/*
Theme Name: MDA
Theme URI: http://zachjanice.com
Description: A website using Bootstrap 3 built for the MDA of Kansas City
Author: Zach Janice
Author URI: http://zachjanice.com/
Version: 1.0
Tags: responsive, bootstrap
*/

@import url('css/bootstrap.min.css');
@import url('css/style.css');

您需要注册css文件的最高信息。如果您的bootstrap / custom css文件位于名为“css”的文件夹中,Wordpress将为您提取这些文件,而无需注册每个css文件。

这是一个可能有用的代码的链接。 https://codex.wordpress.org/Child_Themes

希望这有帮助。

相关问题