Configuring your project
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.
When you create a project in Kirki, the first thing you have to do is create a configuration. Configurations allow each project to use a different setup and act as identifiers so it’s important you create one. Fields that belong to your configuration will inherit your config properties.
Kirki::add_config( $config_id, $args );
Kirki::add_config( 'theme_config_id', array( 'capability' => 'edit_theme_options', 'option_type' => 'theme_mod', ) );
capability: any valid WordPress capability. See the WordPress Codex for details.
option_type: can be either
theme_mod. We recommend using
theme_mod. If however you choose to use
optionyou need to understand how your data will be saved, and in most cases you will also have to use the
option_nameargument as well.
option_name: If you’re using options instead of theme mods then you can use this to specify an option name. All your fields will then be saved as an array under that option in the WordPress database.
disable_output: Set to
trueif you don’t want Kirki to automatically output any CSS for your config (defaults to
To create a field that will then use this configuration you can add your fields like this:
Kirki::add_field( 'theme_config_id', $field_args );