0

我在我的 Wordpress 网站中安装了 enfold 主题。我试过以下事情

1)我创建了一个名为 - enfold-child 的文件夹 2)我在该文件夹中创建了两个文件 1)style.css 2)functions.php 3)父主题的屏幕截图 enfold

现在我已经像这样在 style.css 中放置了代码

/*
Theme Name: Enfold
Description: <strong>A superflexible and responsive Business Theme by Kriesi</strong> - <br/> Update notifications available on twitter and facebook:<br/> <a href='http://twitter.com/kriesi'>Follow me on twitter</a><br/> - <a href='http://www.facebook.com/pages/Kriesi/333648177216'>Join the Facebook Group</a>
Version: 2.2
Author: Kriesi
Author URI: http://www.kriesi.at
License: Themeforest Split Licence
License URI: -
Theme URI: www.kriesi.at/themes/enfold/
Template: enfold
*/

但是当我在管理面板中打开主题时,此消息会显示在 enfold child - 此子主题需要其父主题 Enfold。

所以我在哪里弄错了

我的 enfold 父主题有这样的代码

- /*
Theme Name: Enfold
Description: <strong>A superflexible and responsive Business Theme by Kriesi</strong> - <br/> Update notifications available on twitter and facebook:<br/> <a href='http://twitter.com/kriesi'>Follow me on twitter</a><br/> - <a href='http://www.facebook.com/pages/Kriesi/333648177216'>Join the Facebook Group</a>
Version: 2.2
Author: Kriesi
Author URI: http://www.kriesi.at
License: Themeforest Split Licence
License URI: -
Theme URI: www.kriesi.at/themes/enfold/
*/


/*
* PLEASE DO NOT EDIT THIS FILE!
* 
* This file is only in your themefolder for WordPress to recognize basic theme data like name and version
* CSS Rules in this file will not be used by the theme. 
* Instead use the custom.css file that is located in your themes /css/ folder to add your styles. 
* You can copy a style rule from any of your css files and paste it in custom.css and
* it will override the original style. If you just want to add small css snippets you might also
* want to consider to add it to the designated CSS option field in your themes backend at: Theme Options->Styling
*/

请帮忙

4

3 回答 3

2

你不需要做任何事情,你可以下载现成的enfold child主题..只需复制以下链接并粘贴到浏览器的地址栏中...

https://kriesi.at/files/enfold-child.zip

如果要创建自定义项,请查看以下链接。

https://vimeo.com/67221517

我希望你会喜欢.. :)

于 2013-12-12T05:48:41.553 回答
1

您需要在子主题的 style.css 中添加代码,如下所示

/*
 Theme Name:     your child theme name
 Theme URI:      http://example.com/child-theme-url/
 Description:    your Child Theme desc
 Author:         your author name
 Author URI:     http://example.com
 Template:       enfold
 Version:        1.0.0
*/

/* =Imports styles from the parent theme
-------------------------------------------------------------- */
@import url('../enfold/style.css');

模板:是您的父主题文件夹名称。我希望这将有助于解决您的问题。

于 2013-10-04T06:39:03.313 回答
1

您需要包含Template: enfold在您的子主题的 style.css 中。

请参阅儿童主题http://codex.wordpress.org/Child_Themes的官方 wordpress 文档链接,并特别阅读这部分:

....您可以更改每一行以适合您的主题。唯一需要的行是主题名称和模板。Template 是父主题的目录名。在这种情况下,父主题是 TwentyThirteen 主题,所以 Template 是二十三,这是 TwentyThirteen 主题所在目录的名称......

于 2013-10-04T08:12:48.597 回答