我需要使用WoodPress覆盖Woocommerce的页面模板位置。
所有页面模板都存储在主题根文件夹中,我想将woocommerce文件(如single product.php)移动到自定义子文件夹中。
文件夹应该在相同的主题(my-主题/自定义/single-product.php)
我在谷歌上读了很多书,但还没有找到一个明确的答案。谢谢
<?php
/* functions.php */
Timber::$dirname = array( 'templates', 'templates/woo-templates');
http://timber.github.io/timber/#changing-the-default-folder-for-twig-files
上面的代码将首先在tem板
中查找,然后在. twig模板的woo-tem板
子目录中查找