Jump to Navigation Jump to Main Content Jump to Footer
Home » Docs » Files and folders structure

Files and folders structure

Top‑level files

  • style.css — Theme base stylesheet.
  • theme.json — Global styles & Gutenberg settings.
  • functions.php — Theme bootstrap; registers supports, loads classes.
  • Template entry points: index.php, single.php, page.php, archive.php, search.php, author.php, 404.php, header.php, footer.php.
  • Woo template loader: woocommerce.php — Prepares context and loads Woo Twig templates.
  • Build tooling: webpack.config.js, package.json, composer.json.
  • Coding standards: phpcs.xml, twig_cs.php, prettier.config.mjs, stylelint.config.mjs, .eslintrc.cjs, .editorconfig.
  • Misc: screenshot.jpg, README.md.

Directories

  • inc/ — PHP source (namespaced Chisel\\...). Key subdirs:
    • inc/WP/ — Core WP integration: assets, blocks, AJAX, etc. Example: inc/WP/Assets.phpinc/WP/AjaxEnpoints.phpinc/WP/Blocks.php
    • inc/Plugin/ — Plugin integrations. Examples: inc/Plugin/Woocommerce.phpinc/Plugin/GravityForms.php
    • inc/Controllers/ — Controllers for routes/AJAX. Example: inc/Controllers/AjaxController.php
    • inc/Helper/ — Helper utilities. Examples: inc/Helper/WoocommerceHelpers.phpinc/Helper/GravityFormsHelpers.php
    • inc/Factory/ — Factories/registrars (e.g., blocks). Example: inc/Factory/RegisterBlocks.php
  • src/ — Theme source assets (authored code):
    • src/scripts/ — JS modules and entrypoints. Examples: src/scripts/modules/utils.jsload-more.jsslider.js
    • src/styles/ — SCSS organized by layers (elements/objects/etc.). Examples: src/styles/elements/_form.scsssrc/styles/objects/_grid.scss
    • Blocks source (native or ACF) compiled by build system (final assets land in build/).
  • views/ — Twig templates (rendered via Timber):
    • views/*.twig — Page and layout templates.
    • views/components/* — Reusable components/partials (e.g., post item, pagination).
    • views/woocommerce/* — WooCommerce templates (archive-product.twig, single-product.twig, content-product.twig, etc.).
  • assets/ — Static design assets used at build time:
    • assets/fonts/ — Webfonts (.woff2).
    • assets/icons/ and assets/icons-source/ — Built SVG sprite and sources.
    • assets/images/ — Theme images.
    • assets/hashes.php — Build hash map (autogenerated).
  • build/ — Compiled output from npm run build:
    • build/scripts/*.js — JS bundles (frontend, admin, editor, login).
    • build/styles/*.js|*.asset.php — Enqueued style entrypoints (including gravity-formswoocommercemain).
    • build/blocks*/ — Compiled blocks (block.json, index.js, view.js).
    • Note: PHPCS excludes build/.
  • acf-json/ — Exported ACF field groups for sync.
  • patterns/ — Block patterns for the editor.
  • languages/ — Translation files (empty by default).
  • .vscode/ — Workspace settings/tasks for VS Code.
  • node_modules/ and vendor/ — Dependencies (created in devcontainer, mounted as volumes).

Where to add things

  • PHP logicinc/ under the appropriate layer:
    • WP internals → inc/WP/
    • Plugin integrations → inc/Plugin/
    • Reusable helpers → inc/Helper/
    • Routes/AJAX controllers → inc/Controllers/
  • JSsrc/scripts/ (create a module in modules/ and import from entry as needed).
  • SCSSsrc/styles/ (follow existing layer conventions).
  • Twigviews/ and views/components/; Woo views in views/woocommerce/.
  • Assets (icons/fonts/images)assets/ (sources), then rebuild.
  • Blocks: Copy / paste exisiting block end modify to your needs. Sources go under src/ and build to build/.

Do you like Chisel?

Give it a star on GitHub!