0
add_action('customize_register', 'themename_customize_register');

function themename_customize_register($wp_customize) {

    $wp_customize->add_section('ignite_custom_logo', array(
        'title' => 'Logo',
        'description' => 'Display a custom logo?',
        'priority' => 25
    ));

    $wp_customize->add_setting('custom_logo', array(
        'default' => ''
    ));

    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_logo', array(
        'label' => 'Custom logo',
        'section' => 'ignite_custom_logo',
        'settings' => 'custom_logo'
    )));

}

I followed the above snippets but I have faced some issues. if I add the image from customizing it returns warning in console section.

this is error

Mixed Content: The page at 'https://dev-' was loaded over HTTPS, but requested an insecure image 'http://dev-'. This content should also be served over HTTPS.

can u please explain why this happened to me?

  • Nothing in this code would cause that issue. What code are you using to output the logo in the template? – Jacob Peattie Jun 25 '18 at 11:16
  • <a class="white-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" id="site-logo" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <img src="<?php echo get_theme_mod( 'm1_logo' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"> </a> This is what i have used for rendering the logo in frontend via customise settings – user7364147 Jun 30 '18 at 10:22
  • What is m1_logo? Your question says custom_logo. – Jacob Peattie Jun 30 '18 at 11:43
  • actually, I renamed the value custom_logo to m1_logo. – user7364147 Jul 7 '18 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.