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.
- Enqueue stylesheets and scripts. See Theme Development and Building.
- Contains a function for adding classes to
<body>and a function that adds a 'Continued' link to excerpts.
- 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.
- Control the output of page titles.
- The theme wrapper. See Theme Wrapper.