Created
February 8, 2019 20:46
-
-
Save ben-heath/c008d4b55496d63b2e43fd5341dea7b8 to your computer and use it in GitHub Desktop.
Add custom customizer sections / panels for Wordpress child theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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