Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typography not working in 3.0.10 #1564

Closed
stylethemes opened this issue Oct 4, 2017 · 3 comments
Closed

Typography not working in 3.0.10 #1564

stylethemes opened this issue Oct 4, 2017 · 3 comments

Comments

@stylethemes
Copy link

hi
so I'm working with kirki on a theme im developing and i'm facing a little problem with the typography

here is the code I'm using the problem is when i change the font family nothing happens even when i did the use the typography filed still nothing happens

font using a select field

kirki::add_field( 'my_config', array(
        'type'      => 'select',
		'setting'   => 'blog_font_family',
		'label'     => __( 'blog Font Family', '' ),
		'section'   => 'typography_options',
		'default'   => 'Roboto',
        'choices'   => Kirki_Fonts::get_font_choices(),
        'output'      		=> array(
            array(
                'element'  		=> 'h1.entry-title',
                'property' => 'font-family',
            ),            
        ),
    ));

font using typography field

kirki::add_field( 'my_config', array(
	'type'        => 'typography',
	'setting'   => 'blog_font_family',
	'label'       => esc_attr__( 'Headers Typography', '_s' ),
	'description' => esc_attr__( 'Select the typography options for your headers.', '_s' ),
	'help'        => esc_attr__( 'The typography options you set here will override the Body Typography options for all headers on your site (post titles, widget titles etc).', '_s' ),
	'section'   => 'typography_options',
	'priority'    => 10,
	'default'     => array(
		'font-family'    => 'Roboto',
		'variant'        => '400',
		 'font-size'      => '16px',
		'line-height'    => '1.5',
		// 'letter-spacing' => '0',
		// 'color'          => '#333333',
	),
	'output' => array(
		array(
			'element' => 'h1.entry-title',
		),
	),
) );

in both examples when i do change the font family in the customizer nothing happens.

is there is something I'm missing because i think the style get generated automatically when using the output argument

Version used: 3.0.10

Using theme_mods or options?

theme_mods
@victoras
Copy link

victoras commented Oct 5, 2017

+1

@aristath
Copy link
Contributor

aristath commented Oct 5, 2017

This seems to be working fine:

Kirki::add_field( 'kirki_demo', array(
	'type'        => 'typography',
	'settings'    => 'body_typography',
	'label'       => esc_attr__( 'Body Typography', '_s' ),
	'description' => esc_attr__( 'Select the main typography options for your site.', '_s' ),
	'help'        => esc_attr__( 'The typography options you set here apply to all content on your site.', '_s' ),
	'section'     => 'typography',
	'priority'    => 10,
	'default'     => array(
		'font-family'    => 'Roboto',
		'variant'        => '400',
		'font-size'      => '16px',
		'line-height'    => '1.5',
		'color'          => '#333333',
	),
	'transport' => 'auto',
	'output'    => array(
		array(
			'element' => 'body',
		),
	),
) );

Do you by any chance have any CSS rules in a css file that may be overriding the CSS rules that Kirki outputs?

@stylethemes
Copy link
Author

stylethemes commented Oct 6, 2017

yeah its working fine now all i did is updating the kirki-fallback.php file i think it was causing the problem now everything is working fine

@aristath aristath closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants