I want to create a child theme. But my parent theme is different from the child theme. Parent theme and child theme have 2 different styles. The parent theme is the LeadEngine theme and the child theme is Ave theme. Here is my child theme style.css file.
/*
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");
And after this code, there is child theme style code.
Here is my function.php file.
/**
* 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' );
But it is showing an error.
Warning: include_once(C:xampphtdocspyxle/wp-content/themes/leadengine/liquid/liquid-init.php): failed to open stream: No such file or directory in C:xampphtdocspyxlewp-contentthemesave-childfunctions.php on line 22
Warning: include_once(): Failed opening 'C:xampphtdocspyxle/wp-content/themes/leadengine/liquid/liquid-init.php' for inclusion (include_path='C:xamppphpPEAR') in C:xampphtdocspyxlewp-contentthemesave-childfunctions.php on line 22
Fatal error: Uncaught Error: Call to undefined function liquid_helper() in C:xampphtdocspyxlewp-contentthemesave-childheader.php:10 Stack trace: #0 C:xampphtdocspyxlewp-includestemplate.php(723): require_once() #1 C:xampphtdocspyxlewp-includestemplate.php(672): load_template('C:\xampp\htdocs...', true) #2 C:xampphtdocspyxlewp-includesgeneral-template.php(41): locate_template(Array, true) #3 C:xampphtdocspyxlewp-contentthemesleadenginefront-page.php(13): get_header() #4 C:xampphtdocspyxlewp-includestemplate-loader.php(106): include('C:\xampp\htdocs...') #5 C:xampphtdocspyxlewp-blog-header.php(19): require_once('C:\xampp\htdocs...') #6 C:xampphtdocspyxleindex.php(17): require('C:\xampp\htdocs...') #7 {main} thrown in C:xampphtdocspyxlewp-contentthemesave-childheader.php on line 10
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
The 500 error comes from the missing function – which I presume is included in the missing included file – check your file paths to ensure you are calling the include_once in the correct place.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0