Я ищу несколько предложений о том, как переопределить или заменить некоторые функции, которые загружаются в родительской теме, и переместить их в дочернюю тему, чтобы мы могли вносить изменения в сами файлы в дочерней теме.
Мы продублировали структуру и файлы родительской темы в дочернюю тему, но пока не можем найти способ предотвратить загрузку родительской темы и вместо этого загрузить файлы дочерней темы.
По сути, это все файлы require, перечисленные ниже, которые мы будем дублировать и изменять в дочерней теме, но нам нужно найти способ переопределить родительский functions.php.
Мы пробовали несколько способов сделать это, но пока никак не можем заставить это работать.
Это текущий родительский файл functions.php:
/**
* moto functions and definitions
*
* @package moto
*/
if ( ! function_exists( 'moto_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function moto_setup() {
global $pagenow;
if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
wp_redirect(admin_url("options-general.php?page=moto-system-status")); // Your admin page URL
exit();
}
/* snip irrelevant code */
}
endif; // moto_setup
add_action( 'after_setup_theme', 'moto_setup' );
/* snip irrelevant code */
add_action( 'after_setup_theme', 'moto_content_width', 0 );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function moto_widgets_init() {
/* snip irrelevant code */
}
add_action( 'widgets_init', 'moto_widgets_init' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/function/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/function/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/function/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/function/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/function/jetpack.php';
require_once get_template_directory() . '/include/aq_resizer.php';
require_once get_template_directory() . '/include/moto-sys-req.php';
require_once get_template_directory() . '/include/moto-enqueue.php';
require_once get_template_directory() . '/include/moto-functions.php';
require_once get_template_directory() . '/include/theme_plugin/plugin-activate-config.php';
require_once get_template_directory() . '/include/wordpress-reset.php';
Какие-либо предложения?
Заранее спасибо.
Я голосую за то, чтобы закрыть этот вопрос как не по теме - было бы лучше на сайте WordPress StackExchange, wordpress.stackexchange.com.
Хорошо спасибо за вашу помощь






См. wordpress.stackexchange.com/questions/253034/…