2013-10-04 60 views
0

我已經在我的Wordpress網站中安裝了主題。我曾嘗試下面的東西如何創建兒童主題?

1)我有建立一個文件夾命名爲 - 擁抱孩子 2)我有一個文件夾 1)的style.css 2)的functions.php 3)母公司的截圖中創建兩個文件主題擁抱在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 
*/ 

,但是當我在管理面板很開放的主題在擁抱孩子該消息顯示 - 此子主題需要它的父主題,擁抱。

那麼,這是否我錯了

我擁抱父主題有這樣

- /* 
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 
*/ 

代碼請幫

回答

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'); 

模板:是您的父主題文件夾名稱。 我希望這將有助於解決您的問題。

+0

我已經做了這一點,但消息沒有改變 – 2013-10-04 08:23:51

+0

把模板名稱是你的父主題文件夾名 –

+0

是的,這是擁抱的我的父母主題文件夾名稱 – 2013-10-04 11:30:03

1

您需要在您的兒童主題的style.css中包含Template: enfold

參看兒童主題http://codex.wordpress.org/Child_Themes &這個WordPress官方文檔的鏈接閱讀特別是這部分:

....你可以改變這些線,以滿足您的主題。唯一的 必需的行是主題名稱和模板。模板是 父主題的目錄名稱。在這種情況下,父主題 是TwentyThirteen主題,所以模板是twentythirteen,這 是在TwentyThirteen主題所在的目錄的名稱....

+0

我已經這樣做了,但消息沒有改變 – 2013-10-04 08:23:26