【问题标题】:Wordpress CSS / Less not workingWordpress CSS / 少不工作
【发布时间】:2018-03-19 19:51:00
【问题描述】:

我正在尝试将 CSS 添加到我的主题中。我用较少的代码编写并使用 grunt 将其编译为 style.css 文件。 Grunt 工作正常,css 文件看起来正确。在我的在线帐户中,我可以看到 css 文件,wordpress 将 style.css 标识为样式表,但 css 在网站上不起作用。你能看出我的错吗?

header.php

<!DOCTYPE html>
<head>
<title>

</title>

<?php wp_head(); ?>
</head>

functions.php

<?php function adding_css() {
wp_enqueue_style('css-style', get_stylesheet_uri()); } add_action('wp_enqueue_scripts', 'adding_css' );

style.css

#footer{display:flex;flex-flow:wrap}.footer .try{color:red;height:2px}body{height:20px}html{width:5px}

【问题讨论】:

    标签: css wordpress less


    【解决方案1】:

    哦,该死的,我发现我的错了。

    我将functions.php 包含在一个js 子文件夹中,Wordpress 没有在其中找到它。现在可以了。

    【讨论】:

      猜你喜欢
      • 2015-10-11
      • 2015-10-24
      • 2023-03-07
      • 2016-09-12
      • 2022-06-14
      • 2015-03-06
      • 2015-02-05
      • 2014-12-15
      • 2013-09-15
      相关资源
      最近更新 更多