如何解决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 举报,一经查实,本站将立刻删除。