greenpeace / planet4-child-theme-nordic
Planet4 Child theme for GP Nordic
Installs: 3 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 10
Forks: 1
Open Issues: 3
Language:SCSS
Type:wordpress-theme
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.1
- laminas/laminas-dom: ^2.12
- phpunit/phpunit: ^7.5||^9.5
- slevomat/coding-standard: ~8.8
- squizlabs/php_codesniffer: ^3.7
- wp-coding-standards/wpcs: ^2.3.0
- wpackagist-plugin/timber-library: 1.22.*
- yoast/phpunit-polyfills: ^1.0
- dev-master
- v1.47.5
- v1.47.4
- v1.47.3
- v1.47.2
- v1.47.1
- v1.47
- v1.46
- v1.45
- v1.44
- v1.43
- v1.42.1
- v1.42
- v1.41
- v1.40
- v1.0.39
- v1.0.38
- v1.0.37.1
- v1.0.37
- v1.0.36
- v1.0.35.1
- v1.0.35
- v1.0.34
- v1.0.33
- v1.0.32
- v1.0.31
- v1.0.30
- v1.0.29
- v1.0.28
- v1.0.27
- v1.0.26
- v1.0.25
- v1.0.24
- v1.0.23
- v1.0.22
- v1.0.21
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- dev-develop
- dev-release/v1.47.5
- dev-dependabot/npm_and_yarn/webpack-5.97.1
- dev-release/v1.47.4
- dev-dependabot/npm_and_yarn/multi-8a78b74388
- dev-dependabot/npm_and_yarn/multi-4678547bc2
- dev-feat/chartlist
- dev-fix/allow_block_types_all
- dev-snyk-upgrade-d65a3c9327fe967a725dd3b6e00c3446
- dev-fix/update-node-packages
- dev-release/v.1.17.3
- dev-snyk-upgrade-1e01f68c4748f4f89876c572d78f792f
- dev-feat/timber-2
- dev-snyk-upgrade-cc8d2807a8f4ae5735a39e6a9fa970df
- dev-snyk-upgrade-ce86991be92781f5de2ea260bf72b17e
- dev-snyk-upgrade-747f0a88346214b8f8f1aac0e5dde749
- dev-snyk-upgrade-4e0c5f187f49219eeb9457d7d6f5477d
- dev-snyk-upgrade-e9f01c9237d3ada964d590cb43099f92
- dev-snyk-upgrade-3bc2acf66f387492ec1a1bd7aacc9f38
- dev-snyk-upgrade-98838aacfdb01151ec3f05f1addd68f6
- dev-quote-register-style
- dev-sun-nav-another-level
- dev-snyk-upgrade-79cf94e7bb4a0f53d23bfd68c054714a
- dev-snyk-upgrade-0c720c795ad8b869400875abb98b229a
- dev-lp-multisep
- dev-fix/php-type-error
- dev-missing-block-patterns
- dev-snyk-upgrade-b6e97eb436b0c1e470acb9d4605a99f3
- dev-snyk-upgrade-4d64153817b6224cabf888fa289543c3
- dev-SB-119-hook-allowed_block_types-deprecated
- dev-snyk-upgrade-0e548f6e3427e62bc83acfccb1fd8c32
- dev-snyk-upgrade-fc7e3eb7eb8e66822eff9e8937b1d798
- dev-snyk-upgrade-d834ed6f54fe41089848739325a3b9d8
- dev-snyk-upgrade-7f29ae539993cbbc3276963e144e9828
- dev-SB-111-page-template-to-hide-from-search
- dev-fix/warning-invalid-foreach
- dev-snyk-upgrade-e80bea45860434dcb5a5386ba088f306
- dev-snyk-upgrade-f2a2bc601dfaef89791960e62ec32461
- dev-snyk-upgrade-3c883f7ab0ec2a675a5301a65ac19e3c
- dev-possible-menu-patch
- dev-feature/theme-dev
This package is auto-updated.
Last update: 2025-01-20 07:38:26 UTC
README
c# Greenpeace Planet 4 Nordic Child Theme
The Planet 4 Nordic Child Theme is a child theme built for the Planet 4 project. It customizes the parent theme by adding unique features and styles specific to the Nordic region. This child theme customisez the Planet4 Master Theme following this Design System.
Table of Contents
Prerequisites
Make sure you have the following tools installed on your machine:
- Node.js (v16 recommended)
- npm (comes with Node.js)
- Composer (for PHP dependencies and coding standards)
- WordPress setup (parent theme and WordPress installation)
Installation
To install and set up the theme locally, follow these steps:
-
Clone the repository:
git clone https://github.com/greenpeace/planet4-child-theme-nordic.git
-
Navigate to the theme directory:
cd planet4-nordic-child-theme
-
Install the npm dependencies:
Run
npm install
to install all necessary Node.js packages:npm install
-
Install Composer dependencies:
Run
composer install
to install PHP dependencies (like coding standards):composer install
-
Activate the theme:
- Upload the child theme to your WordPress
/wp-content/themes
directory. - Activate the theme from the WordPress admin dashboard (
Appearance > Themes
).
- Upload the child theme to your WordPress
Usage
Once installed, the theme can be customized and extended as per the needs of the Nordic campaign. The child theme inherits most of its functionality from the parent theme, but you can add custom styles, templates, and features as needed.
To modify or add features to the theme, navigate to the planet4-nordic-child-theme
directory, make changes to the appropriate files, and use the provided npm scripts for development.
Development
Available npm Scripts
-
Build CSS: Compiles the SCSS files into a minified CSS file.
npm run build:css
-
Build: Compiles all assets for production using Webpack and outputs them to the
build/
directory.npm run build
-
Start: Launches a development server with live reloading and builds assets in development mode.
npm run start
-
Lint CSS: Lints the SCSS files to ensure coding standards are followed.
npm run lint:css
Composer Scripts for PHP Code Standards
-
Fixes: Automatically fixes PHP code style issues.
composer run fixes
-
Sniffs: Runs PHP CodeSniffer (
phpcs
) to check PHP files against coding standards.composer run sniffs
File Structure
Here's a brief overview of the key directories and files in the project:
planet4-nordic-child-theme/
├── assets/ # Compiled theme assets (CSS, JS)
│ ├── build/ # Output directory for compiled and minified production assets
│ └── src/ # Source SCSS and JS files
├── includes/ # Theme-specific PHP includes
├── page-templates/ # Theme-specific Twig templates
├── vendor/ # Composer dependencies
├── functions.php # Main theme functions
├── webpack.config.js # Webpack configuration for asset bundling
├── style.css # Main stylesheet (import parent theme styles)
├── package.json # Node.js dependencies and npm scripts
├── composer.json # PHP dependencies and Composer scripts
└── README.md # Project documentation (this file)
Customization
To override parent theme styles, place your custom SCSS files in the assets/src/scss/
directory. These files are automatically compiled and output to assets/build/
when running the build scripts.
Coding Standards
We follow WordPress Coding Standards to ensure clean, readable, and maintainable code.
The coding standards are enforced through phpcs
(PHP CodeSniffer) and can be automatically corrected using phpcbf
. Composer handles both tools.
To check for coding standard violations:
composer run sniffs
To automatically fix issues:
composer run fixes
Contributing
We welcome contributions! To contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b feat/my-feature
). - Make your changes.
- Push your branch (
git push origin feat/my-feature
). - Open a Pull Request.
Please ensure that your code follows the project's coding standards. Use npm run lint:css
for CSS and composer run sniffs
for PHP.
License
This project is licensed under the GNU License. See the LICENSE file for details.