1

A theme I'm using modified a woocommerce that I'd like undo in my child theme.

It's been added as shown:

function theme_setup(){
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
    add_action( 'woocommerce_before_main_content', 'mod_output_content_wrapper', 10 );
}

How do I remove the add_action?

I tried just using remove_action, but that didn't work.

1 Answer 1

3

Found the answer here: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme--cms-22623

<?php
function child_remove_parent_function() {
    remove_action( 'woocommerce_before_main_content', 'mod_output_content_wrapper', 10 );
}
add_action( 'wp_loaded', 'child_remove_parent_function' );
?>

Explanation is in the link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.