The "background" control

Learn how to create controls using Kirki

Back to 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.

The background control allows you to have every CSS background property under one roof.


Kirki::add_field( 'theme_config_id', array(
	'type'        => 'background',
	'settings'    => 'background_setting',
	'label'       => esc_attr__( 'Background Control', 'textdomain' ),
	'description' => esc_attr__( 'Background conrols are pretty complex - but extremely useful if properly used.', 'textdomain' ),
	'section'     => 'section_id',
	'default'     => array(
		'background-color'      => 'rgba(20,20,20,.8)',
		'background-image'      => '',
		'background-repeat'     => 'repeat',
		'background-position'   => 'center center',
		'background-size'       => 'cover',
		'background-attachment' => 'scroll',
) );
Edit this page