小编Pau*_*nez的帖子

如何在WordPress中覆盖子主题中的小部件?

我想在我的父主题中的PHP文件中进行简单的修改:

wp-content\themes\sailing\inc\widgets\gallery\tpl\base.php
Run Code Online (Sandbox Code Playgroud)

所以我在我的子主题中创建了相同的文件夹结构,并在此文件中进行了我需要的修改.我还复制/粘贴了声明这个小部件所需的所有PHP文件.

wp-content\themes\sailing\inc\widgets\widgets.php  
wp-content\themes\sailing\inc\widgets\gallery\gallery.php

wp-content\themes\sailing-child\inc\widgets\widgets.php  
wp-content\themes\sailing-child\inc\widgets\gallery\gallery.php
Run Code Online (Sandbox Code Playgroud)

我在这里错过了什么?

php wordpress overriding widget

6
推荐指数
2
解决办法
6999
查看次数

标签 统计

overriding ×1

php ×1

widget ×1

wordpress ×1