• Resolved Themico

    (@themico)


    Hello,

    thank you very much for your plugin. It’s not the first time I use it and it’s really great.

    I never used typography control before. The problem I have is simple – whatever I do, the font customization only works in customizer mode. As soon as I save it, and then close customizer or just reload the page, fonts are back to default. So only javascript of the controls affect the page as soon as IU’m in customizer mode. But not the frontend part that supposes to enqueue saved (options is really saved fine) google fonts files. Other controls are working fine.

    // Config
    Kirki::add_config( 'twentysixteen', array(
    	'capability'  => 'edit_theme_options',
    	'option_type' => 'theme_mod',
    ) );
    
    	Kirki::add_section( 'theme_typography', array(
    	    'title'          => esc_html__( 'Typography', 'twentysixteen' ),
    	    'priority'       => 100,
    	    'capability'     => 'edit_theme_options',
    	) );
    
    		Kirki::add_field( 'color_theme', [
    			'type'        => 'typography',
    			'settings'    => 'twentysixteen-body_font',
    			'label'       => esc_html__( 'Body', 'twentysixteen' ),
    			'section'     => 'theme_typography',
    			'default'     => [
    				'font-family'    => 'Montserrat',
    				'variant'        => '300',
    				'font-size'      => '17px',
    				'line-height'    => '1.6',
    				'color'          => '#181818',
    				'text-transform' => 'none',
    			],
    			'priority'    => 10,
    			'transport'   => 'auto',
    			'output'      => [
    				[
    					'element' => 'body',
    				],
    			],
    		] );

    Am I missing something simple? I read the documentation and search on this support forum, but looks like I am the only one who has such a problem.

    Thank you.

    • This topic was modified 6 years, 11 months ago by Themico.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Are you by any chance adding the fields inside a hook? Maybe something like customize_register?

    Thread Starter Themico

    (@themico)

    No, I add this code right in the functions.php, without any hook or function.

    Thread Starter Themico

    (@themico)

    Sorry for the confusion. It was my fault – I just messed with one parameter. Everything is working fine now.

    Please delete this thread if possible.

    I’m glad you managed to figure it out. 🙂
    Unfortunately posts on ww.wp.xz.cn can’t be removed, so I’ll just go ahead and close this one as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Typography doesn’t apply on frontend, only in customizer mode’ is closed to new replies.