Theme logo is a standard feature of WordPress. You can simply add the following code to your functions.php
function theme_logo() { add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 400, 'flex-width' => true ) ); } add_action( 'after_setup_theme', 'theme_logo' );
Now you can change the logo in the theme customizer. No need to handle files and options yourself.
Question and answer is powered by AnsPress.io