• Hello everbody.
    I have an question about registering Customizer API styles.
    For example i have aa.php file that consist of codes like :

    <?php $example_color = get_theme_mod(“text_color”); ?>
    <style>
    h1{color:<?php echo $example_color; ?>
    </style>`

    What is the right method of registering this style codes?
    Includeing in the header.php .. or ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    try this code:
    function mytheme_customize_css()
    {
    ?>
    <style type=”text/css”>
    h1 { color: <?php echo get_theme_mod(‘header_color’, ‘#000000’); ?>; }
    </style>
    <?php
    }
    add_action( ‘wp_head’, ‘mytheme_customize_css’);

    
    <php
    function mytheme_customize_css()
    { 
      <style type= " text/css">
       h1{ color:<?php echo get_theme_mod('header_color','#000000');?>;}
      </style>
    }
    add_action('wphead''mytheme_customize_css');
    
    • This reply was modified 6 years, 3 months ago by Jose Castaneda. Reason: added backticks for code
    Thread Starter Kazimli Jahangir

    (@jahangirwp)

    Thanks worked ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to apply Customizer colors ?’ is closed to new replies.