• Hello everyone.
    I have a problem with Customizer API.
    So , when i configurate Customizer API , i can’t upload any image.
    How can i fix this issue ?

    Customizer codes here :

    function wv_customize_register( $wp_customize ) {
    $wp_customize->add_section( 'wv_background_settings' , array(
        'title'      => __( 'Background Settings', 'wv' ),
        'priority'   => 30,
    ) );
    $wp_customize->add_setting( 'wv_background_color' , array(
        'default'   => '#000000',
        'transport' => 'refresh',
    ) );
    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'bck_clr', array(
    	'label'      => __( 'Background Color', 'wv' ),
    	'section'    => 'wv_background_settings',
    	'settings'   => 'wv_background_color',
    ) ) );
    
     
    
    }
    add_action( 'customize_register', 'wv_customize_register' );
    
    ?>
    
    <style type='text/css'>
    body{background-color:<?php echo get_theme_mod('wv_background_color') ;?>;}
    </style>
    
     
    <?php
     
    function wv_customize_css()
    {
        ?>
             <style type="text/css">
    body{background-color:<?php echo get_theme_mod('wv_background_color') ;?>;}
             </style>
        <?php
    }
    add_action( 'wp_head', 'wv_customize_css');
    
    ?>

    But when remove this codes , uploading works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Why are you outputting a style block on file load? (The one not wrapped in a function) Doing so prevents headers from working properly. Just remove it, the one output with the “wp_head” action should suffice.

    Thread Starter Kazimli Jahangir

    (@jahangirwp)

    Thanks for answer , worked!
    The problem was really there ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizer API and Upload problem.’ is closed to new replies.