Theme Functionality

functions.php is used to include files from the lib/ directory which contains all of the theme functionality. Don’t place any custom code in this file — use it only for includes.

Since Sage is a starter theme, it’s okay for you to modify files within lib/ to meet the needs of the site you’re building.

The PHP code in Sage is namespaced, so make sure to use namespaced functions and classes.

lib/assets.php
Enqueue stylesheets and scripts. See Theme Development and Building.
lib/extras.php
Contains a function for adding classes to <body> and a function that adds a 'Continued' link to excerpts.
lib/setup.php
Enable/disable theme features, set configuration values, register navigation menus, sidebars, and define theme support for WordPress core functionality such as post thumbnails, post formats, and HTML5 markup. See Theme Configuration and Setup.
lib/titles.php
Control the output of page titles.
lib/wrapper.php
The theme wrapper. See Theme Wrapper.