如何自定义 WordPress 中的小部件
我想删除外观/小部件中的一些小部件区域。我想删除“主要小部件区域”、“辅助小部件区域”和“第四页脚小部件区域”,以便用户只能看到外观/小部件中的其他三个页脚小部件区域。
有办法做到这一点吗?
第二个问题是,我怎样才能允许每个区域有 1 个小部件。这样用户就只能将 1 个小部件添加到我想在外观/小部件中显示的三个小部件区域中的几个小部件区域中?
谢谢, 荆斯
i want to remove some of the Widget Areas in Appearance/Widgets. I want to remove the "Primary Widget Area", the "Secondary Widget Area" and the "Fourth Footer Widget Area", so that the User only can see The three other Footer Widget Areas in Appearance/Widgets.
Is there a way to do this?
Second Question is, how can i just allow 1 Widget per Area. So that the User just can add only 1 Widget to a several Widget Area of the three that i want to show in Appearance/Widgets?
Thx,
Jings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
小部件区域在主题的 functions.php 中分配。您应该找到类似以下内容的内容:
删除您想要删除的任何小部件区域。
另外,我相当确定你不能限制每个区域的小部件数量,除非你愿意破坏 WordPress 核心(这是不可取的,并且会在每次更新时被覆盖)。
The widget areas are assigned in your theme's functions.php. You should find something along the lines of:
Delete whatever widget areas you want to get rid of.
Also, I'm fairly certain that you cannot limit the number of widgets per area unless you're willing to screw with the wordpress core (which is not advisable and would be overwritten with every update).