【发布时间】:2020-05-30 05:18:05
【问题描述】:
我从 nightingale 主题创建了一个子主题,但是当我尝试更改 nigthingale-child/style.css 中的属性时,它不适用。例如,我尝试更改正文的背景颜色或为 h1 标记不显示任何内容,只是为了查看我的子主题 style.css 是否有效,但没有任何反应。
我已按照创建子主题的所有步骤操作: - 新文件夹 nightingale-child - 在这个 foder 中,我添加了两个文件:function.php 和 style.css 这是我的 style.css:
/*
Theme Name: nightingale-child
Theme URI: http://example.com/twenty-fifteen-child/
Description: nightingale Child Theme
Author: John Doe
Author URI: http://example.com
Template: nightingale
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: nightingalechild
*/
a {
color: red;
}
这是我的function.php:
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
有人知道我的夜莺儿童主题有什么问题吗?
【问题讨论】:
标签: wordpress