Unique Headers
Features
The Unique Headers Plugin adds a custom header image box to the post/page edit screen. You can use this to upload a unique header image for that post, or use another image from your WordPress media library. When you view that page on the front-end of your site, the default header image for your site will be replaced by the unique header you selected.
This functionality also works with categories and tags.
Requirements
You must use a theme which utilizes the built-in custom header functionality of WordPress. If your theme implement it’s own header functionality, then this plugin will not work with it.
Paid WordPress development
If you would like to pay for assistance, additional features to be added to the plugin or are just looking for general WordPress development services, please contact me via my contact form.
Development
This section is only relevant for developers building the plugin from source (e.g. cloning from GitHub). If you installed via WordPress.org, the plugin is ready to use — no build steps required.
The plugin uses Composer for PHP autoloading and dependencies, npm for JavaScript tooling, and TypeScript for admin JavaScript.
To set up a development environment:
- Install PHP dependencies:
composer install - Install JavaScript dependencies:
npm install - Compile TypeScript to JavaScript:
npm run build
To run tests and analysis:
- PHPCS (PSR-12 coding standards):
composer phpcs - Auto-fix PHPCS violations:
composer phpcbf - PHP-CS-Fixer (dry-run):
composer cs - PHP-CS-Fixer (auto-fix):
composer cs:fix - PHPStan static analysis:
composer phpstan - PHPUnit unit tests:
composer test - TypeScript type checking:
npm run typecheck
TypeScript source files are in src/ts/. The compiled output is written to assets/admin.js and is what WordPress loads on the admin side.
Credits
Thanks to the following for help with the development of this plugin: * redactuk – Assistance with debugging. * crabsallover – Assitance with debugging. * Todd – Assistance with implementing support for tags. * Mariano J. Ponce – Spanish translation. * Tobias Klotz – Deutsch (German) language translation. * Nadia Tokerud – Proof-reading of Norsk Bokmål (Norwegian) translation. * Bjørn Johansen – Proof-reading of Norwegian Bokmål translation. * Karl Olofsson – Proof-reading of Swedish translation. * Jenny Beaumont – French translation.
