kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Background control not working

Open TheSkullCat opened this issue 7 years ago • 6 comments

Issue description:

Background control output only visible during customizer transport. After which output is not saved inline or on external css file.

Further the setting is saved. If I refresh the customizer, the new selected value shows in the color picker, but not on the front end or the customizer preview.

Version used:

3.0.44

Using theme_mods or options?

theme_mod

Code to reproduce the issue (config + field(s))

$config_id = 'gt';
Kirki::add_config( $config_id, array(
	'capability'    => 'edit_theme_options',
	'option_type'   => 'theme_mod',
) );

Kirki::add_panel( 'color_panel', array(
    'priority'    => 4000,
    'title'       => esc_html__( 'gt Colors', 'gothemes' ),
    'description' => esc_html__( 'gt color settings', 'gothemes' ),
) );

Kirki::add_section( 'color__header_section', array(
    'title'          => esc_html__( 'Header', 'kirki' ),
    'panel'          => 'color_panel',
    'priority'       => 400,
) );

Kirki::add_field( $config_id, [
	'type'        => 'background',
	'settings'    => 'color__header__background',
	'label'       => esc_html__( 'Header background', 'kirki' ),
	'section'     => 'color__header_section',
	'default'     => [
		'background-color'      => 'rgba(20,20,20,.8)',
		'background-image'      => '',
		'background-repeat'     => 'repeat',
		'background-position'   => 'center center',
		'background-size'       => 'cover',
		'background-attachment' => 'scroll',
	],
	'transport'   => 'auto',
	'output'      => [
		[
			'element' => '.siteheader',
		],
	],
] );

TheSkullCat avatar Jul 11 '19 12:07 TheSkullCat

Are you using the develop or master branch? Or the plugin?

DannyCooper avatar Jul 11 '19 17:07 DannyCooper

I was using the developer branch. Iv integrated the plugin from WordPress repo now and the issue is not present with that.

TheSkullCat avatar Jul 12 '19 00:07 TheSkullCat

Confirmed bug.

Note, even when 'transport' => 'auto', is set, the previewer still refreshes on change.

DannyCooper avatar Jul 12 '19 09:07 DannyCooper

Fixed

aristath avatar Jul 14 '19 12:07 aristath

Does this issue fixed? I used kirki from wordpress background not created any css in the front end. Today I downloaded it from github and installed when the customizer is open and in that shows output. But if I open in several tab or others the output shows nothing. The typography control also works when I'm in the customizer but leaving customizer output shows nothing.

Kirki::add_field('servicepages_header', [

'type' => 'background',
'settings' => 'servicepages_settings',
'label' => esc_html__('Background', 'kirki'),
'description' => esc_html__('Background conrols are pretty complex - but extremely useful if properly used.', 'kirki'),
'section' => 'servicepages_setting_section',

'default' => [
	'background-color' => 'rgba(20,20,20,.8)',
	'background-image' => '',
	'background-repeat' => 'repeat',
	'background-position' => 'center center',
	'background-size' => 'cover',
	'background-attachment' => 'scroll',
],

'transport' => 'auto',
'output' => [
	[
		'element' => '#headerarea',
	],
],

]);

rashed-877 avatar Jan 29 '20 07:01 rashed-877

@rashed-877 the most likely explanation is that you're probably adding your controls inside a hook instead of directly calling them. Did you perhaps add them on customize_register or something like that?

aristath avatar Feb 15 '20 10:02 aristath