Just revamped. Got feedback? Share now.

Privacy
Subscribe

WP: Add Support for Custom Logo in Theme

By Aqsa Jamil Published 26 Nov, 2022 Modified 26 Nov, 2022 Viewed 153 times Read in 0m 54s
Experience Based
Content Validity: Valid and Applicable Comprehension: Level 2 – For Professionals

Add support for custom logo image upload in Wordpress website using Wordpress built-in function.

Custom logo can be used in dynamic top navigation bars or other places within theme. Add a support for setting custom logo using WordPress built-in function from the backend.

Step 1: Add custom logo support using add_theme_support function in functions.php of child theme or parent or where needed.

add_theme_support( 'custom-logo');
  1. Go to the Admin Dashboard > Appearance > Customizer > Site Identity
  2. Set the logo image

There are two ways to print custom logo on frontend of website.

Method 1: With markup

Just use the_custom_logo() function to print logo image with img markup. No need of echo since it already echos the markup directly.

<?php the_custom_logo(); ?>

Method 2: Without markup, just get the source

If you have defined your custom logo image markup already, read ‘WP get custom logo image URL‘ guide. It’ll also help you to get the custom logo URL or source in different custom image sizes.

×

Your feedback matters.

Our standardized editorial process ensures right, timely, and healthy updates to our content. Your honest opinion drives significant improvement to our content. We appreciate you are taking time to share that.

×