WordPress - Failing to override woocommerce templates

半世苍凉 提交于 2019-12-25 18:38:00

问题


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 ?

Thank you for your concern.


回答1:


While the directory structure in the WooCommerce plugin itself is:

/plugins/woocommerce/templates/

You should define it like the following in your theme (note the missing templates dir):

/yourtheme/woocommerce/

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.




回答2:


make a Woocommerce folder inside the theme directory and then follow the folder structure symmetry as in the plugin for the fallback to work properly.

Hope it will work



来源:https://stackoverflow.com/questions/30751082/wordpress-failing-to-override-woocommerce-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!