Roots is an independent open source org, supported only by developers like you. Weβve been improving the WordPress developer experience since 2011, and your support keeps it independent.
Adding Theme Functionality in Sage
The app/ directory contains all 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.
Most of the PHP code in Sage is namespaced and autoloaded, so make sure to use namespaced functions and classes. If you aren't familiar with these methods, see our blog posts on:
The app/ directory
-
app/setup.phpβ Enqueue stylesheets and scripts, register support for theme features withadd_theme_support, register navigation menus and sidebars. See Theme Configuration and Setup. -
app/filters.phpβ Add WordPress filters in this file. Filters included by default:excerpt_moreβ add "β¦ Continued" to excerpts.
-
app/Providersβ The place for any Service Providers you care to define for your theme. Comes withThemeServiceProviderthat adds no functionality but provides a template for your own Service Providers. -
app/Viewβ The place for view-related code, i.e. Composers and Components. For more information, see the documentation on Composers and Components.
Last updated