Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
The examples you’ve seen are out of date. From WordPress 4.5, released in 2016, the proper way to support a custom logo was to register support for the Custom Logo feature in your theme. That link has the full documentation, but the short version is that you use this code to enable the standard logo … Read more