A WordPress development environment for the Kunst Journalismus project using wp-env for local development.
This repository serves as the central point where all developments regarding the webpage are collected and can be deployed. It includes a custom WordPress theme (kuj-theme) and uses WordPress's local development environment tool for easy setup and testing.
- WordPress (German v6.8.3)
- wp-env - WordPress local development environment
- PHP 8.2
- Node.js - for build tools and package management
- Composer - for PHP dependency management
Make sure you have the following installed on your system:
-
Install Node.js dependencies:
npm install
-
Install Composer dependencies:
composer install
To start the WordPress development environment:
npm startThis will:
- Start the WordPress environment using wp-env
- Set up WordPress with German localization
- Activate the custom
kuj-theme - Enable WordPress debug mode
- Mount the uploads directory to
./data/uploads
The site will be available at:
- Frontend: http://localhost:8888
- Admin: http://localhost:8888/wp-admin (admin/password)
To stop the development environment:
npm stopThe project includes various linting and code quality tools:
PHP Code Standards:
# Check PHP code standards
npm run lint:php
# Auto-fix PHP code standards
npm run lintfix:phpJavaScript/CSS Linting:
# Lint JavaScript
npm run lint:js
# Auto-fix JavaScript issues
npm run lintfix:js
# Lint CSS
npm run lint:cssThe theme supports German localization:
# Prepare translation files
npm run i18n:prepare
# Compile translation files
npm run i18n:compile├── .wp-env.json # wp-env configuration
├── package.json # Node.js dependencies and scripts
├── composer.json # PHP dependencies
├── data/
│ └── uploads/ # WordPress uploads directory
└── kuj-theme/ # Custom WordPress theme
- Follow WordPress coding standards
- Use the provided linting tools before committing
- Ensure all translations are properly compiled
- Test changes in the local wp-env environment
Environment won't start:
- Make sure Docker is running
- Check if ports 8888 and 8889 are available
- Try
npm run stopand thennpm startagain
Theme not showing:
- The theme should auto-activate, but you can manually activate it in wp-admin
- Check that the theme files are in the
kuj-themedirectory
Permission issues with uploads:
- Make sure the
data/uploadsdirectory has proper write permissions