I
I
imaniman2020-09-07 13:32:51
WordPress
imaniman, 2020-09-07 13:32:51

How to use remove_action in child theme?

Hello everyone, I need to move the buy button and price tag from one place to another, I'm using a child theme from oceanwp, I write

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_add_to_cart', 10 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_price', 5 );

and remove_action does not work in any way, I googled, hung up on different hooks

add_action ('init', 'removeOldFunction');
remove_action( 'template_redirect', 'alienship_nice_search_redirect' );
}

and tried inserting

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

into different content-single-product files, incl. parent theme, does not work in any way, that just did not try, tell me what's wrong?
5f560c5071574270324445.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Druzhaev, 2020-09-08
@OtshelnikFm

Not init, but later try - template_redirect for example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question