psiweb
Member
Posted 4 months ago #
Hi Everyone,
I am trying to remove a function from a parent theme and insert my own from the functions.php in my child theme. Actually I just want to update one little piece of the code everything else I can control via css. I am using Sandbox as my parent theme and I would like to change the function:
sandbox_widgets_init
I can not figure out how to do this, I have been trying to research it and maybe I am just missing something as I am fairly new to wordpress development, any suggestions would be greatly appreciated.
You will need to create your own version of the sandbox_widgets_init() function in your child theme's functions.php file.
psiweb
Member
Posted 4 months ago #
Thanks for the reply. I had tried to do this and it gives me an error:
Fatal error: Cannot redeclare sandbox_widgets_init() (previously declared...
psiweb
Member
Posted 4 months ago #
As usual, I think I tried to over complicate this, I was able to get my function to work by removing the action and adding my action to it simply by adding the code below:
remove_action( 'init', 'sandbox_widgets_init' );
add_action( 'init', 'mysandbox_widgets_init' );
Thanks for the quick reply.