All Courses > Up and Running > Chapters > Anatomy of a WordPress Theme

Anatomy of a WordPress Theme

Key Takeaways:

A WordPress theme is made of a set of consistent parts. The crucial parts of a theme include style.css, functions.php, and several kinds of PHP template file (such as header.php, footer.php, and index.php).
As the theme's main source of CSS styling, style.css dictates the theme's visual appearance. A comment section at the top of style.css is also where the theme name, author, etc., are registered.
functions.php is where you add presentational functionality to your theme. Through functions.php, you'll add CSS stylesheets, JavaScript files, nav menus, widget areas, and other functionality.
Template files can be informally divided into: "always-used" template files (header.php and footer.php, and sidebar.php if applicable); files in the WordPress template hierarchy (such as index.php, single.php, and page.php); and "template parts" (incomplete snippets pulled from other template files to reduce repetition).

This short chapter revolves around a big di...