Archived topic
Remove Customizer Color Sections
5 replies · Started by Andrew on December 14, 2022
I'm attempting to remove a few of the Customizer color sections. I'm using this in my child theme's functions.php:
function loud_remove_customizer_sections( $wp_customize ) {
$wp_customize->remove_section('buttons_color_section');
$wp_customize->remove_section('sidebar_widget_color_section');
}
add_action( 'customize_register', 'loud_remove_customizer_sections', 20 );
But the sections are still showing up in the Customizer. Is it possible to remove some of them? Thanks!
Have a look here -> https://docs.generatepress.com/article/remove-all-gp-customizer-options/
I'm not trying to remove all of the options. I just want to remove some of the sections on the Colors panel.
Hi there,
Give this a shot:
add_action( 'customize_register', function( $wp_customize ) {
$wp_customize->remove_control( 'generate_buttons_colors_title' );
$wp_customize->remove_control( 'generate_sidebar_widgets_colors_title' );
$wp_customize->remove_control( 'generate_footer_widgets_colors_title' );
}, 1000 );
You can get the correct ID from the inspector tool:
https://www.screencast.com/t/4pCgbw9XAc
Thank you Leo! This worked perfectly. Really appreciate it.
No problem :)