Adding Panels and Sections

How to add kirki to your project.

Configuring Project Add Panels and Sections Controls

The documentation site is currently being rewritten. If you can't find what you're looking for please check the github issues and ask for assistance there until the documentation rewrite is complete.

Adding Panels

Panels are wrappers for sections, a way to group multiple sections together. To see how to create Panels using the WordPress Customizer API please take a look at these docs.

Using Kirki:

Kirki::add_panel( 'panel_id', array(
    'priority'    => 10,
    'title'       => esc_attr__( 'My Panel', 'textdomain' ),
    'description' => esc_attr__( 'My panel description', 'textdomain' ),
) );

The Kirki::add_panel() method is nothing more than a wrapper for the WordPress customizer API and therefore follows the exact same syntax. More information on WordPress Customizer Panels can be found on the WordPress Codex.

Adding Sections

Sections are wrappers for controls, a way to group multiple controls together. All fields must belong to a section, no field can be an orphan. To see how to create Sections using the WordPress Customizer API please take a look at these docs.

Using Kirki:

Kirki::add_section( 'section_id', array(
    'title'          => esc_attr__( 'My Section', 'textdomain' ),
    'description'    => esc_attr__( 'My section description.', 'textdomain' ),
    'panel'          => 'panel_id',
    'priority'       => 160,
) );

The Kirki::add_section() method is nothing more than a wrapper for the WordPress customizer API and therefore follows the exact same syntax. More information on WordPress Customizer Sections can be found on the WordPress Codex

Edit this page