I’m creating a child theme from Storefront.

Now I want to remove these action in child theme

add_action( 'woocommerce_before_shop_loop','storefront_sorting_wrapper',9 );

by this function:

add_action( 'after_setup_theme','remove_action', 100 );
  function remove_action() {
    remove_action( 'init', 'woocommerce_before_shop_loop');
  }

but it doesn’t work!

2

For removing an action hook you should use the same action name, callback name and the priority that was used to add a action in parent theme.
And register it on init

add_action( 'init', 'remove_my_action');
function remove_my_action() {
     remove_action( 'woocommerce_before_shop_loop','storefront_sorting_wrapper',9 );
}

Read about remove_action

Leave a Reply

Your email address will not be published. Required fields are marked *