更改 Wordpress 木材模板位置
Change Wordpress Timber Template locations
我需要使用 timber Wordpress 覆盖 Woocommerce 的页面模板位置。
所有页面模板都存储在主题根文件夹中,我想移动 woocommerce 文件
(如 single-product.php)到自定义子文件夹。
文件夹应为同一主题(my-theme/custom/single-product.php)
我已经阅读了 google,但未能找到明确的答案。
谢谢
<?php
/* functions.php */
Timber::$dirname = array( 'templates', 'templates/woo-templates');
http://timber.github.io/timber/#changing-the-default-folder-for-twig-files
上面的代码将首先在 templates
中查找,然后在 woo-templates
子目录中查找 .twig 模板
我需要使用 timber Wordpress 覆盖 Woocommerce 的页面模板位置。
所有页面模板都存储在主题根文件夹中,我想移动 woocommerce 文件 (如 single-product.php)到自定义子文件夹。
文件夹应为同一主题(my-theme/custom/single-product.php)
我已经阅读了 google,但未能找到明确的答案。 谢谢
<?php
/* functions.php */
Timber::$dirname = array( 'templates', 'templates/woo-templates');
http://timber.github.io/timber/#changing-the-default-folder-for-twig-files
上面的代码将首先在 templates
中查找,然后在 woo-templates
子目录中查找 .twig 模板