Wordpress 未覆盖的电子商务模板

Wordpress 未覆盖的电子商务模板,wordpress,woocommerce,Wordpress,Woocommerce,我试图覆盖一个woocommerce插件,但不知何故它不起作用。 在我的自定义主题中,我在functions.php中添加了以下内容 function add_theme_wc_support() { add_theme_support('woocommerce'); add_theme_support('woocommerce-composite-products'); } add_action('after_setup_theme', 'add_theme_wc_suppo

我试图覆盖一个woocommerce插件,但不知何故它不起作用。 在我的自定义主题中,我在functions.php中添加了以下内容

function add_theme_wc_support() {
    add_theme_support('woocommerce');
    add_theme_support('woocommerce-composite-products');
}

add_action('after_setup_theme', 'add_theme_wc_support');
我的模板的目录:

theme\templates\woocommerce-composite-products\single-product\template-file.php
我编辑了模板,但什么也没发生。我还试图将文件夹“woocommerce复合产品”改为“woocommerce”,但什么也没有

myfunctions.php只包含“add_theme_wc_support”函数,因此不会有任何冲突


我怎样才能做到这一点

根据您提供的关于插件希望您如何覆盖模板的评论,您的文件路径应该如下所示


并非所有插件都允许您这样做,我是通过艰苦的方式学会的。检查插件中的文件,也许你遗漏了什么,通常会有一条注释解释如何“模板覆盖”。@butted_Toast它说:“yourtheme/woocommerce/single product/component single page.php”。这就是为什么我很困惑为什么它不起作用,但在你的问题中,你说这是你的目录=theme\templates\woocommerce复合产品\single product\template-file.php。目录需要是主题/woocommerce/single product/component single page。php@Buttered_Toast是的,我也试过了。我两个都试过了,但都不起作用。刚才我把它切换回woocommerce,什么也没发生。