Theme Functions

In the last few chapters, you've seen some examples of code that can be placed in a theme's functions.php file in order to add or modify WordPress features: changing user contact fields, changing roles, even adding and removing roles. Here, you'll learn more basic uses of the functions .php file.

You've probably realized by now that PHP functions can be placed in any theme file. That means you can create functions right in your template; however, if it's something you'll want to reuse in other templates, it's best to put it in the theme functions file or a plugin (which I'll talk about in Chapter 9).

0 0

Post a comment