issue on creating child theme

时间:2020-11-16 作者:Sabbir33

我想创建一个子主题。但我的父主题与子主题不同。父主题和子主题有两种不同的样式。父主题是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

1 个回复
最合适的回答,由SO网友:Q Studio 整理而成

500错误来自丢失的函数(我认为它包含在丢失的包含文件中),请检查文件路径,确保在正确的位置调用include\\u一次。

相关推荐

Child-theme breaks site

所以,我有一个子主题,里面除了所需的CSS文件之外什么都没有。一旦我激活了这个儿童主题,我的整个网站就关闭了。最后我有两个问题:激活一个只有CSS的子主题怎么能破坏我的网站</我怎样才能回到我原来的主题</这些是网站给我的错误:Warning: require_once(/wp-content/themes/interio_child/admin/options-framework.php) [function.require-once]: 无法打开流:中没有此类文件或目录/wp-c