无法在wordpress主题

时间:2017-10-03 04:06:38

标签: php html css wordpress

我无法在我的wordpress主题上获得简单的CSS更改

我将gulp.js处理的SASS与浏览器同步处理到我主题文件夹根目录下的style.css文件中。

h1 {
    font-size: 3em;
    color: green;
}

h2 {
    font-size: 2.6em;
    color: blue;
}

在我的wordpress主题上,我在页面上填充了H1和H2标签

enter image description here

WP-content文件夹结构在PHPstorm

上看起来像这样

enter image description here

我在wordpress管理员下选择了主题,我是不是在某种程度上没有在我的主题中引用我的style.css文件?或者可能需要在index.php / index.html中指定它?

修改

它现在工作正常,我第一次排队样式正确不确定为什么它不能提前工作

enter image description here

3 个答案:

答案 0 :(得分:1)

我认为您需要在header.php文件中包含样式表。

请参阅:How to include styles.css in wordpress theme?

答案 1 :(得分:1)

您可以将它放在编辑器中的style.css文件中,方法是将其放在同一个主题css区域中,例如位置为E:\ XAMPP \ htdocs \ project-example \ wp-content \ themes \ twentysixteen \ css

答案 2 :(得分:1)

你不需要在head中添加样式表,默认的style.css应该使用下面的函数排列在functions.php中。

wp_enqueue_style( 'text-domain-style', get_stylesheet_uri() );

如果这样做了。只需清除缓存或使用隐私浏览,或确保下面没有任何样式覆盖您的样式更新。(css层次结构)