6. Theme Foundation

Every good theme requires a good foundation. In this chapter, we’ll implement a strong base for our theme by evaluating the structure of the template files, calling template files correctly, and creating our first set of WordPress hooks.

By the end of this chapter, you’ll have a good understanding of how to communicate with other template files in our theme, utilize WordPress hooks for best practices, implement plugins, and extrapolate content rather than duplicate it.

What you’re about to learn

• The structure of the <head> element and its importance for theming

• WordPress theme requirements

• How to link to external files in our theme

• The opening <body> tag

• How and why we maintain separate header.php and footer.php ...

Get Web Designer’s Guide to WordPress: Plan, Theme, Build, Launch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.