$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>How to override parent theme actions|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How to override parent theme actions

matteradmin10PV0评论

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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far