Custom Logo Width and Height in WordPress

Set your own custom logo width and height on a wordpress thild theme.

Let me guess you want to add a logo to your new wordpress theme and wordpress tells you to cut a part of your logo? Of course you cannot run a bussiness showing only half part of your brand! But how to solve this problem?

I did run into this setting up a new child theme for twentynineteen, but of course I wanted a cross theme solution!

The custom logo settings are in your functions.php and if you have a child theme you have to overrule the function that sets the width and height parameters.

Including the following code will give you the option to bypass the cutting and resizing of your logo by wordpress.

function override_frostmm_customlogo() {
add_theme_support( ‘custom-logo’, array(
‘height’ => 50,
‘width’ => 200,
‘flex-height’ => true,
‘flex-width’ => true,
) );
add_action( ‘after_setup_theme’, ‘override_frostmm_customlogo’, 11 );