我已经创建了一个父主题的子主题,它在wp主题选择器上正确显示并激活。
我创建了一个style.css
包含以下元信息的所述子主题:
/*
Theme Name: Twenty Sixteen Child
Theme URI: http://localhost:888/wordpress-test/twentysixteen-child/
Description: My first child theme, based on Twenty Sixteen
Author: Juan D. Bolanos
Author URI: http://synchronygroup.com
Template: Twenty Sixteen
Version: 1.0.0
Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready, responsive-layout, infinite-scroll, post-slider, design, food, journal, magazine, news, photography, portfolio, clean, contemporary, dark, elegant, modern, professional, sophisticated
Text Domain: twentysixteen-child
*/
我创建了一个
function.php
所述主题和使用的文件
wp_enqueue_styles
引用的函数
here<?php
function wordpress_main_style() {
wp_enqueue_style( \'parent-theme\', get_template_directory_uri() . \'/style.css\');
wp_enqueue_style( \'child-theme\', get_stylesheet_uri());
}
add_action( \'wp_enqueue_scripts\', \'wordpress_main_style\' );
?>
我已经包括了
wp_head()
在我的
header.php
然后打电话给我
index.php
. 样式表显示在站点上,如inspector中所示,但“父主题”样式表指向与父目录相对应的子主题目录。
我已确保文件夹名称与“我的孩子”主题中包含的“-child”匹配。我读过这个documentation 确保没有任何错误。
可能缺少哪些内容会导致目录中的错误指示?