pressgang-wp / pressgang
Package for the WordPress PressGang parent theme framework
Installs: 2 070
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Open Issues: 0
Type:wordpress-theme
pkg:composer/pressgang-wp/pressgang
Requires
- php: ^8.0
- doctrine/inflector: ^2.0
- symfony/string: 7.0
- timber/timber: ^2.0
- upstatement/routes: ^0.9.1
This package is auto-updated.
Last update: 2026-02-07 20:16:50 UTC
README
Hijacking Your WordPress Development Workflow
Ahoy there! Modernize your WordPress development and ship your WordPress themes faster than ever. PressGang anchors your workflow in modern development practices. Build cleaner, faster, smarter themes and navigate your development course to calmer seas.
๐ Read the full documentation at docs.pressgang.dev
Overview
PressGang is a WordPress parent theme framework that gives you the architecture of a modern PHP application โ Composer autoloading, Twig templating via Timber, config-driven bootstrapping, and a clear separation of concerns โ without leaving the WordPress ecosystem. Build child themes on a solid, opinionated foundation and spend your time on features, not plumbing.
โจ Key Features
- ๐ Rapid Development โ A solid foundation and conventions that accelerate theme development with clean, modern PHP.
- ๐ฒ Timber + Twig โ Built on Timber to separate template markup from PHP logic through the Twig templating engine.
- ๐ฎ Controller Architecture โ MVC-inspired controllers act as view models, preparing context for templates with a clear separation of concerns.
- โ Convention over Configuration โ Inspired by frameworks like Laravel, repetitive WordPress tasks are bootstrapped via declarative config files โ less boilerplate, more building.
- ๐ฆ Composer & PSR-4 โ Dependency management via Composer and PSR-4 autoloading for a consistent, modern codebase.
- ๐ง Flexible by Design โ Keeps the core WordPress structure intact. Leverage everything you already know while gaining powerful tools and conventions.
๐งญ Core Concepts
โ๏ธ Config-Driven Bootstrapping
Everything in PressGang starts with a config file. Arrays in config/ declare what gets registered โ post types, taxonomies, sidebars, blocks, scripts, styles, and more. Each config file maps to a class in src/Configuration/ by convention (e.g. config/sidebars.php โ Sidebars). No queries, no side effects โ just declarative registration.
๐ฎ Controllers
Controllers live in src/Controllers/ and are view models, not request handlers. Each controller extends AbstractController, gathers data via Timber, builds a context array, and selects a template. They must be side-effect free โ no writes, no remote requests, no direct rendering.
๐ Context Managers
Context managers enrich the global Timber::context() with data needed across many templates โ menus, site info, theme mods, ACF option pages. They implement ContextManagerInterface, are registered via config/context-managers.php, and must be safe to run on every request (frontend, admin, AJAX, CLI).
๐งฉ Twig Extensions
All custom Twig functions, filters, and globals are registered through extension managers configured in config/twig-extensions.php. Twig remains a presentation-only layer โ no database queries, no mutations, no business logic.
๐งฑ Blocks & Snippets
Gutenberg blocks are declared in config/blocks.php and live under blocks/<block-name>/ with a block.json and Twig template. Snippets are reusable view partials registered via config/snippets.php โ self-contained, explicitly parameterised UI components.
๐ Requirements
- PHP 8.3+
- WordPress 6.4+
- Timber 2.0+
- Composer
๐ Getting Started
PressGang is a WordPress parent theme that acts as a framework for your child theme.
Quick Start with PressGang-Child
The fastest way to weigh anchor is with the pressgang-child starter repo:
git clone https://github.com/pressgang-wp/pressgang-child your-theme-name
cd your-theme-name
composer install
Then follow the instructions in that repo's README to configure your child theme.
Manual Setup
-
Clone PressGang into your
wp-content/themes/directory:git clone https://github.com/pressgang-wp/pressgang
-
Create your own child theme that extends PressGang.
Composer Installation
Require PressGang as a dependency in your child theme:
composer require pressgang-wp/pressgang
๐งช Testing
composer install # install dev dependencies composer test # run the unit test suite
Tests use PHPUnit + BrainMonkey โ no WordPress installation required. See the Testing docs for details on writing new tests.
๐ Documentation
Uncover the buried treasure at: docs.pressgang.dev
๐ License
PressGang is open-sourced software licensed under the MIT license.
