最佳实践使用子主题覆盖php文件
我创建了一个Wordpress儿童主题(mytheme Child),其结构如下: style.css最佳实践使用子主题覆盖php文件,php,wordpress,Php,Wordpress,我创建了一个Wordpress儿童主题(mytheme Child),其结构如下: style.css functions.php(空) 文件夹 >php.php 在父主题中,php.php文件通过functions.php文件包含在主题中,其中包含以下条目: require_once( get_template_directory() . '/folder/php.php' ); 如何用子主题php.php覆盖父主题php.php?是否将require\u once()与任何操作挂钩?谢谢您
functions.php(空)
文件夹
>php.php 在父主题中,
php.php
文件通过functions.php
文件包含在主题中,其中包含以下条目:
require_once( get_template_directory() . '/folder/php.php' );
如何用子主题
php.php
覆盖父主题php.php
?是否将require\u once()
与任何操作挂钩?谢谢您的回答。require_once不与任何操作挂钩。我想使用一个子主题来保持主题更新时的更改。我试图通过:mini-Markdown格式问题替换child functions.php中的php.php。很抱歉,在保持父主题未修改的情况下,无法阻止包含。也许你可以阻止php.php内部发生的事情?但是我们需要更多关于php.php的信息。