Site logo

Archived topic

'generate_construct_footer_widgets'

3 replies · Started by David on June 19, 2018

Viewing posts 1–4 of 4

Hi, everyone:

I've tried to remove the action 'generate_construct_footer_widgets' attached to 'generate_footer' action name so I can remove the widgets part. No matter What I do I'm not able to get it right, also tried setting priority number but nothing changes.

I know customizer does it, but that's not what I'm after. Does anyone know how to remove those widgets?

Here's my code in functions.php

add_action( 'after_setup_theme', 'remove_gp_parts' );
function remove_gp_parts {
  remove_action( 'generate_footer', 'generate_construct_footer_widgets' );
}

Thanks in advance.

Hi there,

Try this instead:

add_action( 'after_setup_theme', 'remove_gp_parts' );
function remove_gp_parts {
  remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
}

If the add_action() has a priority, the remove_action() has to as well.

Hi Tom,

Great, that worked! Adding '5' priority to add_action() did it:

add_action( 'after_setup_theme', 'remove_gp_parts', 5 );

Tank you so much for your help!

You're welcome! :)

This archived topic is closed to new replies.