duanjian5059 2016-08-16 19:38
浏览 85
已采纳

如何在Wordpress中组合小部件

I'm trying to merge two widgets that show on the same row (left and right) the template is build to host text on the left and a gravity form on the right. I want instead a full width area without splitting the row in two columns.

The template does this (nasty imo) also in other areas but has some pros that I wish to preserve. How hard would be to turn it into a full width area (1 widget) and what steps should I follow?

  • 写回答

1条回答 默认 最新

  • dtlh12053 2016-08-16 19:59
    关注

    You would create a child theme and then overwrite the template that is being used to create the widget area. You should also disable the widget location that you are removing so that it isn't shown in the admin. You can use the following code to remove the widget area.

    function remove_some_widgets(){
        unregister_sidebar( 'first-footer-widget-area' );
    }
    add_action( 'widgets_init', 'remove_some_widgets', 11 );
    

    You would replace 'first-footer-widget-area' with the identifier for the widget area you are removing.

    I can't give a code example for combining the widget areas because it would depend on the code available in your theme. In case you don't have a child theme, here is a link for how to create one: https://codex.wordpress.org/Child_Themes

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后的密码
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面