Case of Mistaken Identities

Remember, your theme will form just one part of a website. WordPress, plugins, and your theme all work together. If any of your functions' names clash with one from a plugin or WordPress itself, there'll be confusion—and bugs—aplenty. It's a good idea to prefix all your function names with a reasonably unique string—the prevailing best practice in the WordPress community is to use an abbreviated form of your theme's name, as we've done with our Wicked theme throughout the chapter.

It might be tempting to start all your function names with wp (for WordPress) or theme (because it is one, right?), but strings like these are often in use by WordPress and may well cause conflicts. Seriously, stick with the name.

Keep On Exploring

In this chapter, we learned how to override Thematic's templates with code of our own making: we looked at how to create an all-new home page for our child theme with just a little poking and prodding, and how to add new features with hooks and filters.

What we've seen here is only a taster of what's possible: it's time for you to go out there, explore, and come up with some wicked new ways to enhance your theme.

By the way, many of the skills you pick up when adding functions to your theme will stand you in good stead if you ever plan to become a plugin developer: the methodology is much the same. Bonus!

What's in a name?


Was this article helpful?

0 0

Post a comment