Have you noticed that in the Storefront theme there are footer credits for the theme itself and WooCommerce?

It is possible to hide those credits from the Customizer in the Footer section, but it’s nice to keep them around to support the developers. It might be useful though to add your company name as well or change the text to something else that you prefer.

You can do it, as always, via custom code!

This time it’s not a simple snippet though. The only filter that we have for the footer credits is storefront_credit_link, but this one is used to simply hide the entire thing.

We don’t want to do that, also because we have an option for it. We have to use a different method.

Did you know that many of the Storefront functions are pluggable? What does it mean? It means that you can declare a function with the same name of the one included in the theme/plugins without creating a fatal error, and your function will completely replace the one from the core.

The name of the function that prints the footer credits is storefront_credit and you can find it in /wp-content/themes/storefront/inc/storefront-template-functions.php on line 125.

Let’s replace it. Open your functions.php file in wp-content/themes/your-child-theme-name/ and add this code at the end of the file:

This snippet will add a link to your company after the default footer credits. All this is done where you see this code:

by <a href="https://yourdomain.com" title="Your Company Name">Your Company Name</a>.


Just replace these data with your company’s data or anything you prefer, and you’re done!

1 reply
  1. Line
    Line says:

    Hi 🙂
    I use the plugin: code snippets to insert codes but when I use the one above this error occurs:
    The code snippet you are trying to save produced a fatal error on line 16:

    Cannot redeclare storefront_credit() (previously declared in /var/www/www.nordpet.dk/www/wp-content/themes/storefront/inc/storefront-template-functions.php:127)

    And being new in all of this I don’t know what’s wrong?

    Kind regards,
    Line

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

You have to agree to the comment policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.