WordPress-无法覆盖woocommerce模板 [英] WordPress - Failing to override woocommerce templates
问题描述
我试图通过在我的自定义主题目录/woocommerce/模板中复制Woocommerce的模板文件来覆盖它们,但是更改未在网站上出现(我尝试仅添加类开头).我在做错什么吗?
I am trying to override Woocommerce's templates files by duplicating them in my custom theme directory / woocommerce / templates, but the changes don't appear (I tried simply adding classes to begin with) on the website. Is there something I am doing wrong ?
感谢您的关注.
推荐答案
WooCommerce插件本身的目录结构是:
While the directory structure in the WooCommerce plugin itself is:
/plugins/woocommerce/templates/
您应该在主题中定义如下(注意缺少的templates
目录):
You should define it like the following in your theme (note the missing templates
dir):
/yourtheme/woocommerce/
换句话说,您应该将所有替代直接放在woocommerce/
目录中(不会有templates/
目录).这肯定令人困惑.
In other words, you should put all of the overrides directly within the woocommerce/
directory (there will be no templates/
directory). This is definitely confusing.
这篇关于WordPress-无法覆盖woocommerce模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!