The child theme builds on the Sapling Starter Theme, providing a structure for overrides and project-specific customization.
src/scss_globals.scss,_variables.scss,_partials.scss→ base overridespages/→ page-specific styles (about.scss→dist/css/pages/about.min.css)sections/→ reusable block/section styles (bundled intosections.min.css)main.scss→ imports parent globals + variables, then applies child overrides_shared.scss→ central module that@forwards variables/mixins you want available across modules
src/jsmain.js→ default scripts for the child themeadmin.js→ WordPress admin-side scripts
src/vendor- Safe folder for third-party assets you want shipped with the theme.
- Use subfolders for clarity:
/css– Place any vendor stylesheets here (e.g.,slick.css,slick-theme.css).
Files will be copied todist/vendor/css/with the same structure and names./js– Place any vendor scripts here (e.g.,slick.min.js,swiper.min.js).
Files will be copied todist/vendor/js/with the same structure and names.
- No bundling or npm install required. Drop the files in, commit them, and enqueue from the
dist/vendorpath infunctions.php. - Keeps vendor libraries version-controlled and out of
node_modules, ensuring they’re shipped with the theme regardless of environment.
extras/helpers.php→ generic PHP helper functionssetup.php→ theme setup (enqueue, supports, menus, etc.)theme-functions.php→ WordPress-specific functions and filtersajax.php→ central AJAX handlersshortcodes/→ custom shortcodespost-types/→ custom post type definitionsintegrations/→ third-party service or plugin integrations
- Assets always compiled into
dist/:- CSS:
main.min.css,sections.min.css,pages/*.min.css,vendor.min.css - JS:
main.min.js,admin.min.js,vendor.min.js
- CSS:
- Important (Sass modules): Partial files compiled via
@usedo not inherit imports from their parents.
Add this line at the top of any file that relies on shared tokens/mixins:Ensure@use 'shared' as *;
src/scss/_shared.scssre-exports your tokens/mixins, e.g.:// _shared.scss @forward 'variables'; @forward 'mixins';
- External libraries should be imported through
vendor.jsandvendor.scssfor consistency (and enqueued asvendor.min.js/vendor.min.css).