使用WP子主题覆盖主WP主题的子目录中的PHP文件


Using WP Child Theme to override a PHP file within sub directories of main WP theme

以下是文件层次结构:主主题>页面生成器>区块>campaigns-block.php

我编辑了campaigns-block.php以满足我的需求&现在想把它放在我的孩子主题中覆盖。主主题的campaigns-block.php文件。

我该怎么做?

不幸的是,在子主题中,您只能自动覆盖部分模板Heirarchy(header.phppage.php等)。您需要覆盖包含campaigns-block.php的模板文件,并将其指向子主题文件夹中的副本。

有关更多详细信息,请参阅此答案:

https://wordpress.stackexchange.com/questions/62341/override-file-in-parent-theme