WordPress.org

Support

Support » Themes and Templates » [Resolved] Remove Function from Parent Theme

[Resolved] Remove Function from Parent Theme

  • 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    @esmi

    Forum Moderator

    You will need to create your own version of the sandbox_widgets_init() function in your child theme’s functions.php file.

    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…

    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.

    Did you ever figure this out as i’m looking to do the same?

    I have looked everywhere and tried most of what is on the internet but cant get this resolved!

    esmi

    @esmi

    Forum Moderator

    Please post your own topic.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Remove Function from Parent Theme’ is closed to new replies.