Skip to content
Advertisement

WordPress the_custom_logo doesn’t link on homepage

I’m using twentytwentyone-child theme and I want to link the custom_logo to the homepage even on the homepage.

But I can’t find any setting for that?

I read this: https://developer.wordpress.org/reference/functions/the_custom_logo/

And it says: “Displays a custom logo, linked to home unless the theme supports removing the link on the home page.

But if I look into the site-branding.php of the parent-theme I can only find this:

JavaScript

There is no if/else for linking it or don’t link it.

How can I do that?

Advertisement

Answer

This is happening because of this code in the parent theme’s functions.php:

JavaScript

In your child theme’s functions.php, you can remove the theme support, and then add it back again, which you can do with this:

JavaScript

UPDATE: You’ll have to add this code to an action rather than using it directly in functions.php.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement