如何强制WP在运行时始终首先检查子主题文件夹get_template_part
?
示例:子主题加载get_template_part(\'content\', \'inventory\')
在里面single.php
. 由于所有子主题(并且有很多)共享相同的公共库存模板库,因此content-inventory.php
位于父主题中。到目前为止还不错。
我想在上述清单模板中添加一个小部分,这将是每个子主题所特有的。正在添加get_template_part(\'content\', \'inventory-special\')
进入content-inventory.php
不会首先检查子主题目录。