WordPress theme powering softcatala.org, the website of Softcatala — a non-profit organization promoting the Catalan language in technology.
License: GPLv3 or later
This is a WordPress theme built on Timber (v2), which provides Twig as a templating engine. The theme separates PHP logic from presentation:
- PHP templates (root
*.phpfiles) — WordPress template hierarchy entry points. They set up context and render Twig templates. - Twig templates (
templates/) — presentation layer. All HTML output lives here. - Classes (
classes/) — business logic, custom post types, widgets, services. - REST API (
rest/) — custom WP REST endpoints (downloads updater, projects CSV). - WP-CLI commands (
wp-cli/) — data migration and management scripts. - Includes (
inc/) — legacy procedural code: widgets, post type helpers, rewrites, AJAX handlers. - Static assets (
static/) — CSS, JS, fonts, images.
Registered in classes/type-registers/: programa, projecte, esdeveniment, dades-obertes, slider, aparell.
Two autoloading conventions coexist:
SC_prefix — classes likeSC_Foo_Barresolve toclasses/foo-bar.phpSoftcatala\namespace — classes likeSoftcatala\Content\JsonToTableresolve toclasses/content/json-to-table.php(decamelized)
Both are registered in functions.php via spl_autoload_register.
- Downloads updater (
rest/downloads-api.php) — update program download info from external APIs. See REST-API-DOWNLOADS.md for full documentation. - Projects CSV (
rest/projectes-csv-api.php) — projects endpoint.
- PHP >= 7.4
- WordPress (recent versions)
- Timber plugin (v2) installed and active
- Composer
# Install dependencies
composer install
# The theme must be placed in your WordPress wp-content/themes/ directory# Run all checks (PHPCS + PHPMD)
composer code
# PHP CodeSniffer (WordPress coding standards)
composer phpcs
# Auto-fix coding standard violations
composer phpcbf
# PHP Mess Detector
composer phpmdPHPCS is configured in phpcs.xml (WordPress ruleset, targets classes/). PHPMD is configured in phpmd.xml.
# Requires WordPress test suite — see bin/install-wp-tests.sh
phpunitTests live in tests/ with the test- prefix convention. Bootstrap at tests/bootstrap.php.
The wp-cli/ directory contains data converters and management commands (events, programs, sliders, downloads). These are autoloaded when WP_CLI is defined.
- Xavi Ivars (@xavivars)
- Pau Iranzo (@paugnu)
- Miquel Piulats
- Jordi Mas (@jordimas)
- Jaume Ortolà (@jaumeortola)