0
votes

I have decided to use a Woocommerce Storefront child theme called Galleria, when I have previously used the storefront theme I have used the common remove_action to unhook the defaults and replaced with my own add_action.

However as Galleria is a child theme of Storefront, it has its own add_action in the file class-galleria-structure.php though the structure of the add_action seems different.

A typical add_action in storefront looks like this...

add_action( 'storefront_header', 'storefront_site_branding', 20 );

I would usually use the following to unhook it in my functions.php file like so...

remove_action( 'storefront_header', 'storefront_site_branding', 20 );

In the Galleria child theme the add_actions looks like this...

add_action( 'storefront_header', array( 'Galleria_Structure', 'galleria_top_bar_wrapper' ), 1 );
add_action( 'storefront_header', array( 'Galleria_Structure', 'galleria_top_bar_wrapper_close' ), 6 );

So I assumed that by doing the following it would simply unhook them...

remove_action( 'storefront_header', array( 'Galleria_Structure', 'galleria_top_bar_wrapper' ), 1 );
remove_action( 'storefront_header', array( 'Galleria_Structure', 'galleria_top_bar_wrapper_close' ), 6 );

Having tried this in my functions.php file I find it has no effect.

Can someone please point me in the right direction as I am at a loss as to why this is not working.

Thanks All

1

1 Answers

0
votes

Make sure you are calling remove_action after add_action. Also check if function returns true or false.

Usually add_action is hooked on init or after_setup_theme so just try a hook that is executed later on.

Here is a list of all hooks with run sequence http://rachievee.com/the-wordpress-hooks-firing-sequence/