WordPress customizer: load controls in a custom div

Put below codes in your functions.php

function sorcey_customize_register($wp_customize){

$wp_customize->add_section('sorcey_footer', array(
  'title'    => __('New Section', 'text_domain'),
  'description' => '',
  'priority' => 120,
));


/*  =============================
      Text input
===============================*/
$wp_customize->add_setting("sr_copyright", array(
        "default"       => "",
        'capability'  => 'edit_theme_options',
        "transport" => "postMessage",
    ));
    $wp_customize->add_control(new WP_Customize_Control($wp_customize, "sr_copyright_ctrl",
        array(
            "label" => __("Title", "text_domain"),
            "section" => "sorcey_footer",
            "settings" => "sr_copyright",
            "type" => "text",

        )
    ));

}

add_action('customize_register', 'sorcey_customize_register');

Then chek there will be a ‘New Section’

Leave a Comment