N
N
Nick Bukovskiy2018-04-30 19:20:17
WordPress
Nick Bukovskiy, 2018-04-30 19:20:17

How to properly include in a child theme?

In the main theme, in functions.php there is a line like this

include_once get_template_directory().'/theme-includes.php';

This file contains the following
Look...
//define constants
define('QODE_ROOT', get_template_directory_uri());
define('QODE_ROOT_DIR', get_template_directory());
define('QODE_ASSETS_ROOT', get_template_directory_uri().'/assets');
define('QODE_ASSETS_ROOT_DIR', get_template_directory().'/assets');
define('QODE_FRAMEWORK_ROOT', get_template_directory_uri().'/framework');
define('QODE_FRAMEWORK_ROOT_DIR', get_template_directory().'/framework');
define('QODE_FRAMEWORK_MODULES_ROOT', get_template_directory_uri().'/framework/modules');
define('QODE_FRAMEWORK_MODULES_ROOT_DIR', get_template_directory().'/framework/modules');
define('QODE_THEME_ENV', 'dev');

//include necessary files
include_once QODE_ROOT_DIR.'/framework/qode-framework.php';
include_once QODE_ROOT_DIR.'/includes/nav-menu/qode-menu.php';
include_once QODE_ROOT_DIR.'/includes/sidebar/qode-custom-sidebar.php';
include_once QODE_ROOT_DIR.'/includes/qodef-related-posts.php';
include_once QODE_ROOT_DIR.'/includes/qode-options-helper-functions.php';
include_once QODE_ROOT_DIR.'/includes/sidebar/sidebar.php';
require_once QODE_ROOT_DIR.'/includes/plugins/class-tgm-plugin-activation.php';
include_once QODE_ROOT_DIR.'/includes/plugins/plugins-activation.php';
include_once QODE_ROOT_DIR.'/assets/custom-styles/general-custom-styles.php';
include_once QODE_ROOT_DIR.'/assets/custom-styles/general-custom-styles-responsive.php';

if(!is_admin()) {
    include_once QODE_ROOT_DIR.'/includes/qode-body-class-functions.php';
    include_once QODE_ROOT_DIR.'/includes/qode-loading-spinners.php';
}

I need to: Replace the contents of this file.
I copy this file to my child theme and do the same include_once in functions.php, but the file is NOT included. Logically, the child theme is loaded first and should work, but it doesn't. Please tell me what could be the problem

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question