All Courses > Up and Running > Chapters > Core Concepts of WordPress Themes: 3. Adding Functionality with functions.php

Core Concepts of WordPress Themes: 3. Adding Functionality with functions.php

Key Takeaways:

functions.php is a specially named PHP file that can be located inside any WordPress theme. WordPress knows to execute the code in functions.php during its normal PHP processing.
functions.php's job is to add custom functionality to the theme and site. It is composed of PHP functions—small bits of PHP code that add or change functionality across the site.
As functions.php is inside the theme, its functionality additions should all be presentational in nature. Examples include: enqueueing CSS stylesheets and presentational JavaScript files, enabling featured images, registering custom image sizes, and registering navigation menus and widget areas.

functions.php is the "brain" of a WordPress theme: it's where we dictate all kinds of presentational functionality—PHP functions that control how things display, rather than the site's underlying data—for the theme.

In this chapter,...