Forum Replies Created

Viewing 1 replies (of 1 total)
  • This works for me:

    // Customize Logo instead of Text
    function themeslug_theme_customizer( $wp_customize ) {
        $wp_customize->add_section( 'themeslug_logo_section' , array(
            'title'       => __( 'Logo', 'themeslug' ),
            'priority'    => 30,
            'description' => 'Upload a logo to replace the default site name and description in the header',
        ) );
    
        $wp_customize->add_setting( 'themeslug_logo',
            'sanitize_callback' == 'esc_url_raw'
        );
    
        $wp_customize->add_control('themeslug_logo',
            array( 'default' => '',
                'sanitize_callback' => 'esc_url_raw',
                'type' => 'theme_mod',
            ));
    
        $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array(
            'label'    => __( 'Logo', 'themeslug' ),
            'section'  => 'themeslug_logo_section',
            'settings' => 'themeslug_logo',
            'sanitize_callback' => 'esc_url_raw',
        ) ) );
    }
    add_action( 'customize_register', 'themeslug_theme_customizer' );
Viewing 1 replies (of 1 total)