Css 如何在Wordpress中激活子主题?

Css 如何在Wordpress中激活子主题?,css,wordpress,parent-child,Css,Wordpress,Parent Child,我创建了一个新的style.css并在子主题中使用它。我在wp content中创建了一个新文件夹,并将其命名为mename child,然后上传我创建的style.css。现在,我进入wp dashboard->Appearance->Themes,查看我创建的子主题。我发现了这个错误: Broken Themes The following themes are installed but incomplete. Themes must have a stylesheet and a te

我创建了一个新的style.css并在子主题中使用它。我在wp content中创建了一个新文件夹,并将其命名为mename child,然后上传我创建的style.css。现在,我进入wp dashboard->Appearance->Themes,查看我创建的子主题。我发现了这个错误:

Broken Themes

The following themes are installed but incomplete. Themes must have a stylesheet and a template.

Name    Description
Accesspress Lite    The parent theme is missing. Please install the "AccesspressLite" parent theme.

有什么我需要上传的吗?请帮帮我。我是WordPress的新手。谢谢大家!

我很清楚,您需要安装父主题,这是安装子主题所必需的

缺少父主题。请安装“AccesspressLite”父主题。


子主题的全部目的是将其调整反馈到父主题中,因此您不必调整父主题设置

否,这里的问题是您必须在child style.css的注释区域中指定父模板

来自Wordpress Codex的示例

/*
 Theme Name:   Twenty Fourteen Child
 Theme URI:    http://example.com/twenty-fourteen-child/
 Description:  Twenty Fourteen Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentyfourteen
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fourteen-child
*/

@import url("../twentyfourteen/style.css");
符合

Template:     twentyfourteen
这是你需要的。您的父主题必须位于相应的文件夹中,在本例中为themes/Twenty14

此外,在父模板中,必须通过get_stylesheet_uri()加载style.css,子主题才能正常工作