Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove sections from GeneratePress Customize area
add_action( 'customize_register', 'generate_remove_sections', 99 );
function generate_remove_sections( $wp_customize )
{
// Remove default sections
$wp_customize->remove_section('body_section');
$wp_customize->remove_section('layout_section');
// Remove Generate Colors sections
$wp_customize->remove_section('header_color_section');
$wp_customize->remove_section('navigation_color_section');
$wp_customize->remove_section('subnavigation_color_section');
$wp_customize->remove_section('content_color_section');
$wp_customize->remove_section('sidebar_widget_color_section');
$wp_customize->remove_section('footer_widget_color_section');
$wp_customize->remove_section('footer_color_section');
$wp_customize->remove_section('form_color_section');
// Remove Generate Typography sections
$wp_customize->remove_section('font_section');
$wp_customize->remove_section('font_content_section');
$wp_customize->remove_section('font_navigation_section');
$wp_customize->remove_section('font_header_section');
// Remove Generate Spacing sections
$wp_customize->remove_section('spacing_section');
// Remove Generate Backgrounds section
$wp_customize->remove_section('backgrounds_section');
// Remove Generate Page Header section
$wp_customize->remove_section('page_header_section');
// Remove Generate Blog sections
$wp_customize->remove_section('blog_post_image_section');
$wp_customize->remove_section('blog_masonry_section');
$wp_customize->remove_section('blog_content_section');
// Remove Generate Secondary Nav sections
$wp_customize->remove_section('secondary_nav_section');
$wp_customize->remove_section('secondary_bg_images_section');
$wp_customize->remove_section('secondary_font_section');
$wp_customize->remove_section('secondary_subnavigation_color_section');
$wp_customize->remove_section('secondary_navigation_color_section');
$wp_customize->remove_section('secondary_navigation_spacing_section');
}
add_action('after_setup_theme','generate_hide_generatepress');
function generate_hide_generatepress()
{
remove_action('customize_controls_print_footer_scripts','generate_customize_preview_js');
remove_action('admin_menu', 'generate_create_menu');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.