Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress-儿童主题赢得';未完成安装_Php_Wordpress_Html - Fatal编程技术网

Php Wordpress-儿童主题赢得';未完成安装

Php Wordpress-儿童主题赢得';未完成安装,php,wordpress,html,Php,Wordpress,Html,我使用HTML5 Blank作为父主题的子主题。我以前使用过这个,没有任何问题,但出于某种原因,我现在在我的主题页面上出现以下错误- 破碎主题 以下主题已安装,但不完整。 名称描述 HTML5空白子主题缺少父主题。请安装“HTML5 blank”父主题。 这是我文件夹中的内容- style.css /* Theme Name: HTML5 Blank Child Theme Description: A child theme of the HTML5 Blank WordPress

我使用HTML5 Blank作为父主题的子主题。我以前使用过这个,没有任何问题,但出于某种原因,我现在在我的主题页面上出现以下错误-

破碎主题 以下主题已安装,但不完整。 名称描述
HTML5空白子主题缺少父主题。请安装“HTML5 blank”父主题。

这是我文件夹中的内容-

style.css

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank
 Version:      1.0.0
*/
我试过很多不同的版本,也抄袭了官方的wordpress指南。上面的措辞在我的上一个项目中对我有效,所以我不知道为什么现在不行

这是我的函数文件-

functions.php

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'html5blank-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>


不知道为什么这不起作用。任何帮助都将不胜感激。

获取父主题的Textdomain并将其作为子主题的模板名。假设您的父主题的Style.css标题如下

/*
 Theme Name:   HTML5 Parent Theme
 Description:  A HTML5 Blank Parent WordPress theme
 Author:       Mike Whitehead
 Text domain: html5blank
 Version:      1.0.0
*/
然后你可以像这样把这个文本域名用在你的子主题中

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank
 Version:      1.0.0
*/

子主题style.css“Template”标记应与父主题文件夹名称匹配,例如

/*
 Theme Name:   HTML5 Blank Child Theme
 Description:  A child theme of the HTML5 Blank WordPress theme
 Author:       Mike Whitehead
 Template:     html5blank-stable
 Version:      1.0.0
*/
根据WordPress儿童主题法典页-


“模板行对应于父主题的目录名。在我们的示例中,父主题是二十五主题,因此模板将是二十五主题。您可能正在使用不同的主题,因此请相应调整。”

父主题和子主题目录的名称是什么?命名约定可能有问题。父主题是否具有此文件夹名称:html5blank@Dedering父目录名为HTML5 blank stable这会改变什么吗?@AkshayShah请查看上面的答案请查看我的答案。子主题“模板”标记应与父主题的文件夹名称匹配。不正确。。。子主题“模板名称”应与父主题的文件夹名称匹配。。。