Theme Functionality
The app/
directory contains all of the theme functionality. Since Sage is a starter theme, it’s okay for you to modify files within app/
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.
app/setup.php
- Enqueue stylesheets and scripts, register support for theme features with
add_theme_support
, register navigation menus and sidebars. See Theme Configuration and Setup.
app/admin.php
- Placeholder code for the WordPress theme customizer. You can also use this file for anything related to the WordPress admin.
app/filters.php
-
Add WordPress filters in this file. Filters included by default:
body_class
— add<body>
classesexcerpt_more
— add "… Continued" to excerptstemplate_include
— enable the theme wrapper- Various filters for the Blade implementation
app/helpers.php
-
Helper functions used throughout the theme:
asset_path
— used when enqueueing theme assets to provide the correct versioned asset filenamesdisplay_sidebar
— used to control displaying the sidebartitle
— used to return page titles