Skip to content

Instantly share code, notes, and snippets.

@ben-heath
Created February 8, 2019 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ben-heath/c008d4b55496d63b2e43fd5341dea7b8 to your computer and use it in GitHub Desktop.
Save ben-heath/c008d4b55496d63b2e43fd5341dea7b8 to your computer and use it in GitHub Desktop.
Add custom customizer sections / panels for Wordpress child theme
<?php
function fod_custom_customizer_options( $wp_customize ) {
$wp_customize->add_section( 'fod_options' , array(
'title' => __('Homepage Popup Form'),
'panel' => '',
'priority' => 1000
) );
$wp_customize->add_setting(
'fod_home_popup_form',
array(
'default' => '',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'fod_home_popup_form_code',
array(
'label' => __( 'Homepage Popup Form', 'respondocustomizer' ),
'description' => __( 'Edit the popup form here.', 'respondocustomizer' ),
'section' => 'fod_options',
'settings' => 'fod_home_popup_form',
'type' => 'textarea'
)
)
);
}
add_action( 'customize_register', 'fod_custom_customizer_options' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment