Site logo

[Resolved] Remove Customizer Color Sections

Home Forums Support [Resolved] Remove Customizer Color Sections

Home Forums Support Remove Customizer Color Sections

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2462012
    Andrew

    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!

    #2462015
    trebere
    #2462024
    Andrew

    I’m not trying to remove all of the options. I just want to remove some of the sections on the Colors panel.

    #2462198
    Leo
    Staff
    Customer Support

    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

    #2462213
    Andrew

    Thank you Leo! This worked perfectly. Really appreciate it.

    #2463253
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.