• Resolved wpfighter

    (@wpfighter)


    This is one of the typographical options in my theme customizer, the code which renders above looks like this →

    `Kirki::add_field( ‘my_config’, array(
    ‘type’ => ‘typography’,
    ‘settings’ => ‘h1_typography’,
    ‘label’ => esc_attr__( ‘H1 Typography’, ‘textdomain’ ),
    ‘section’ => ‘typography’,
    ‘default’ => array(
    ‘font-family’ => ‘Roboto’,
    ‘variant’ => ‘regular’,
    ‘font-size’ => ’14px’,
    ‘line-height’ => ‘1.5’,
    ‘letter-spacing’ => ‘0’,
    ‘subsets’ => array( ‘latin-ext’ ),
    ‘color’ => ‘#333333’,
    ‘text-transform’ => ‘none’,
    ‘text-align’ => ‘left’
    ),
    ‘priority’ => 15,
    ‘output’ => array(
    array(
    ‘element’ => ‘body’,
    ),
    ),
    ) );`

    I am trying to pull the output like this:

    ` function mytheme_customize_css()
    {
    ?>
    <style type=”text/css”>
    h1 { color: <?php get_option( ‘h1_typography’ ); ?>; }
    </style>
    <?php
    }`
    add_action( ‘wp_head’, ‘mytheme_customize_css’);

    I tried both get_option and get_theme_mod, but the output is not rendering whats the fix?

    • This topic was modified 7 years, 2 months ago by wpfighter.
    • This topic was modified 7 years, 2 months ago by wpfighter.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wpfighter

    (@wpfighter)

    Configuration written like this:
    `include_once( dirname( __FILE__ ) . ‘/kirki/kirki.php’ );

    Kirki::add_config( ‘my_theme’, array(
    ‘capability’ => ‘edit_theme_options’,
    ‘option_type’ => ‘theme_mod’,
    ) );

    function mytheme_kirki_configuration() {
    return array( ‘url_path’ => get_stylesheet_directory_uri() . ‘/kirki/’ );
    }
    add_filter( ‘kirki/config’, ‘mytheme_kirki_configuration’ );’

    • This reply was modified 7 years, 2 months ago by wpfighter.

    Closing this one as a duplicate of https://github.com/aristath/kirki/issues/1533

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Out put not working’ is closed to new replies.