WordPress Custom Theme Option Detailed

PHOTO EMBED

Mon May 30 2022 23:35:44 GMT+0000 (Coordinated Universal Time)

Saved by @mickeldav #php

function theme_customizer_function($wp_customize)
{
	$wp_customize->add_panel('theme_options', array(
		'title' => 'Theme Options',
		'priority' => 10,
		'capability' => 'edit_theme_options',
	));
	
	
	$wp_customize->add_section('landing_page_slider', array(
		'title' => 'Slider Section',
		'description' => __('Home Page Slider Customization'),
		'panel' => 'theme_options',
	));
	
	$wp_customize->add_setting('landing_main_header', array(
		'default' => __('The Design Logic')
	));
	$wp_customize->add_control('landing_main_header', array(
		'label' => 'Main Heading',
		'section' => 'landing_page_slider',
		'priority' => 1 
	));
	
    $wp_customize->add_setting('landing_slider_description', array());
    $wp_customize->add_control('landing_slider_description', array(
        'label' => 'Slider Description',
        'section' => 'landing_page_slider',
        'priority' => 2
        ));
        
        
    $wp_customize->add_section('home_abt_sec', array(
        'title' => 'About Section',
        'panel' => 'theme_options',
        'active_callback' => 'is_front_page',
        
        ));  
        
    $wp_customize->add_setting('home_abt_heading', array());    
    $wp_customize->add_control('home_abt_heading', array(
        'label' => 'Heading',
        'section' => 'home_abt_sec',
        'priority' => 1
        ));
        
    $wp_customize->add_setting('home_abt_cnt', array());
    $wp_customize->add_control('home_abt_cnt', array(
        'label' => 'About Content',
        'section' => 'home_abt_sec',
        'type' => 'textarea',
        ));
        
    $wp_customize->add_setting('home_abt_img', array());
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'home_abt_img', array(
	'label' => 'About Section Image',
	'section' => 'home_abt_sec',
	)));
        
        
    $wp_customize->add_section('footer_section', array(
        'title' => 'Footer Section',
        'priority' => 170,
        ));    
    $wp_customize->add_setting('footer_text', array());
    $wp_customize->add_control('footer_text', array(
        'label' => 'Footer Disclaimer',
        'section' => 'footer_section',
        'type' => 'textarea',
        ));
        
}
add_action('customize_register', 'theme_customizer_function');
content_copyCOPY

For get option field value use this code <?php echo get_theme_mod('landing_slider_description', ''); ?>