How To Add Custom Logo Support In WordPress Themes

Looking to add custom logo theme support to your WordPress template? All you may need to add is some functions in your WordPress theme’s functions.php file.

Adding custom logo theme support

To add custom logo theme support to your WordPress theme, you need to add the code below to your WordPress theme’s functions.php file. To do this you can follow the steps below.

  1. Navigate to Appearance > Editor > Theme Functions from your WordPress Dashboard;
  2. Add in the code below and click Update File to save the file;
  3. Navigate to Appearance > Customise and then click Site Identity;
  4. Select your logo and click Publish to save the customisation.
function custom_logo() {
 add_theme_support(
  'custom-logo', array(
    'flex-height' => true,
    'flex-width' => true,
    'header-text' => array(
     'site-title',
     'site-description'
    )
  )
 );
add_action( 'after_setup_theme', 'custom_logo' );

Using a custom logo

To use the custom logo on your WordPress theme, use the WordPress function the_custom_logo(); to display the logo wrapped around your website link.