WordPress filter custom logo link class

WordPress is the most popular CMS framework. When we create the WordPress using Bootstrap Framework Then the “navbar-brand” class is required for display logo on the navigation menu. Let’s see How WordPress filter custom logo link class

Many times we need to add new class or change the “custom-logo-class” with other class. Let’s how we can used the filter for changing the custom logo class. Add the below code on your “functions.php” file.

function thecodingstuff_custom_logo_class( $html ) {
    $html = str_replace('custom-logo-link', 'navbar-brand', $html );
    return $html;
add_filter('get_custom_logo', 'thecodingstuff_custom_logo_class', 10);

So, It’s too easy to change default WordPress custom logo class.

Published by


Hello there, I am developer currently working with the company at Pune and part-time freelancer. Always I welcome a new opportunity.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s