admin管理员组文章数量:1130349
Working on a child theme. On the parent theme functions.php there is a 'widgets_init' action where four sidebars are regsitered. I need to remove three of those sidebars.
What is the propper way to do this?
I already tried :
1) creating a 'widgets_init' functions on the child theme (different function name) with higher priority, with only one 'register_sidebar'. Not working, the four sidebars are still there.
2) remove parent action with remove_action( 'widgets_init', 'wp_bootstrap_starter_widgets_init' ); Not working, the four sidebars are still there.
Then, I tried adding a custom function on the child theme for the 'widgets_init' action, and then, I do a "unregister_sidebar" for each of the sidebars I want to remove. This works, but I don't kmnow if is the best way.
I want to do it the RIGHT way.
Working on a child theme. On the parent theme functions.php there is a 'widgets_init' action where four sidebars are regsitered. I need to remove three of those sidebars.
What is the propper way to do this?
I already tried :
1) creating a 'widgets_init' functions on the child theme (different function name) with higher priority, with only one 'register_sidebar'. Not working, the four sidebars are still there.
2) remove parent action with remove_action( 'widgets_init', 'wp_bootstrap_starter_widgets_init' ); Not working, the four sidebars are still there.
Then, I tried adding a custom function on the child theme for the 'widgets_init' action, and then, I do a "unregister_sidebar" for each of the sidebars I want to remove. This works, but I don't kmnow if is the best way.
I want to do it the RIGHT way.
本文标签: How to override parent theme actions
版权声明:本文标题:How to override parent theme actions 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749021055a2304380.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论