WordPress子主题中的自定义标头header.php替换了header.php

问题描述

我正在尝试在wordpress主题中编辑头文件,但是我不希望在主题更新时覆盖更改。这样,我创建了一个新的header.PHP文件并将其放在子主题中。如何用子主题中的一个覆盖父主题中的header.PHP文件

儿童主题functions.PHP

<?PHP
function my_theme_enqueue_styles() {
 
    $parent_style = 'stylesheet';
 
    wp_enqueue_style( $parent_style,get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/style.css',array( $parent_style ),wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts','my_theme_enqueue_styles' );

我的父母的主题是MTS Woocart

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)