我想创建一个子主题。但我的父主题与子主题不同。父主题和子主题有两种不同的样式。父主题是LeadEngine主题,子主题是Ave主题。这是我的孩子主题风格。css文件。
/*
Theme Name: Ave Child
Theme URI: http://ave.liquid-themes.com/
Author: Liquid Themes
Author URI: https://themeforest.net/user/liquidthemes
Template: leadengine
Description: Smart, Powerful and Unlimited Customizable WordPress Child Theme.
Version: 2.7
License: GNU General Public License
License URI: license.txt
Text Domain: ave-child
Tags: responsive, retina, rtl-language-support, blog, portfolio, custom-colors, live-editor
*/
@import url("../leadengine/style.css");
在这个代码之后,还有子主题样式代码。这是我的功能。php文件。
/**
* The Liquid Themes Ave Theme
*
* Note: Do not add any custom code here. Please use a child theme so that your customizations aren\'t lost during updates.
* http://codex.wordpress.org/Child_Themes
*
* @link https://codex.wordpress.org/Theme_Development
* @link https://codex.wordpress.org/Child_Themes
*
* Text Domain: \'ave\'
* Domain Path: /languages/
*/
// Starting The Engine / Load the Liquid Framework ----------------
add_action( \'wp_enqueue_scripts\', \'enqueue_parent_styles\' );
function enqueue_parent_styles() {
wp_enqueue_style( \'parent-style\', get_template_directory_uri().\'/style.css\' );
}
include_once( get_template_directory() . \'/liquid/liquid-init.php\' );
但它显示了一个错误。
Warning: include_once(C:\\xampp\\htdocs\\pyxle/wp-content/themes/leadengine/liquid/liquid-init.php): failed to open stream: No such file or directory in C:\\xampp\\htdocs\\pyxle\\wp-content\\themes\\ave-child\\functions.php on line 22
Warning: include_once(): Failed opening \'C:\\xampp\\htdocs\\pyxle/wp-content/themes/leadengine/liquid/liquid-init.php\' for inclusion (include_path=\'C:\\xampp\\php\\PEAR\') in C:\\xampp\\htdocs\\pyxle\\wp-content\\themes\\ave-child\\functions.php on line 22
Fatal error: Uncaught Error: Call to undefined function liquid_helper() in C:\\xampp\\htdocs\\pyxle\\wp-content\\themes\\ave-child\\header.php:10 Stack trace: #0 C:\\xampp\\htdocs\\pyxle\\wp-includes\\template.php(723): require_once() #1 C:\\xampp\\htdocs\\pyxle\\wp-includes\\template.php(672): load_template(\'C:\\\\xampp\\\\htdocs...\', true) #2 C:\\xampp\\htdocs\\pyxle\\wp-includes\\general-template.php(41): locate_template(Array, true) #3 C:\\xampp\\htdocs\\pyxle\\wp-content\\themes\\leadengine\\front-page.php(13): get_header() #4 C:\\xampp\\htdocs\\pyxle\\wp-includes\\template-loader.php(106): include(\'C:\\\\xampp\\\\htdocs...\') #5 C:\\xampp\\htdocs\\pyxle\\wp-blog-header.php(19): require_once(\'C:\\\\xampp\\\\htdocs...\') #6 C:\\xampp\\htdocs\\pyxle\\index.php(17): require(\'C:\\\\xampp\\\\htdocs...\') #7 {main} thrown in C:\\xampp\\htdocs\\pyxle\\wp-content\\themes\\ave-child\\header.php on line 10