Themes authors - how to you do the "powered by" in the theme footer

(Zackary Allnutt) #1

This is something I haven’t been doing but noticed that lot’s of theme authors are putting powered by links in the footer.

I’m considering doing the same but wondering how you are allowing for this to be modified? Do you give a option in the customizer or do you expect the user to override this in a child theme?


(Ben) #2

At the moment I hard code it (I make themes for and they have their own code for changing it) but I am planning to change it to a function call that can be filtered so that I can more easily change/ hide it through a plugin.

(Mahdi Yazdani) #3

I prefer to use filters for this, it is quite handy and easy to edit.
Here is an example of theme credit handling using filters.

(Zackary Allnutt) #4

Thanks @mahdiyazdani and @BinaryMoon a filter seems a good way to go

(Leland Fiegel) #5

Great thread! Like @BinaryMoon, at the moment, I hardcode it do be compliant with’s “footer credits must be located in footer.php and match the format found in Underscores” guideline.

It’s not a request I receive often, but I made a tutorial to remove footer credits with a child theme any time I do.

It would be nice to have an easier to use solution though, as the concept of child themes may be difficult for beginners to wrap their heads around.

Curious, do you maintain two separate versions of the theme for .com and self-hosted for this? Or is the function you’re talking about compliant with the aforementioned guideline?

(Ben) #6

I make themes for .com first and then sell them on .org. I add things to the themes, before selling them on .org, but they are all added through hooks and filters so that I only have to maintain a single theme.

I think I could make it compatible with the guidelines. I think the only real requirement is the structure of the credits. I imagine they’re using a regular expression to find and replace the credits info (since the credits are dynamic on .com).

In fact I’ve just checked the underscores footer and it differs to mine anyway :slight_smile:

The footer I use is here:

I’m going to update the granule footer to allow customisation (and make it a bit closer to underscores).

For reference this is the version of the footer before the changes:

UPDATE: I’ve changed the footer now so that we can filter the footer content. If you return true then you can hide the default footer and replace it with whatever content you like through the filter. Not technically how filters are meant to work but does the job :slight_smile:

(Brady Vercher) #7

We’ve been printing footer credits using a custom function that can be filtered for a few years now and released a simple plugin that anyone can use to modify the credits from the customizer. If you’re a theme developer, I’d recommend adding support for it to make things easier for your users.

For those of you with themes on, we add a filter in the wpcom.php file to override the default text. The output does have to be in footer.php to work with whatever regex they’re using, though.