A Gutenberg container block that sticks to the top or bottom of the viewport as visitors scroll. Drop any blocks inside and they follow the reader down the page - no coding required.
- PHP 7.4 or higher
- WordPress 5.8 or higher
- Node.js + npm
- Docker and Docker Compose
echo "127.0.0.1 sticky-block.local" | sudo tee -a /etc/hostscp .env.example .envThe defaults work out of the box.
npm installnpm run buildmake devDocker starts MySQL, WordPress, WP-CLI, and Caddy. The plugin source, compiled build, documentation, and entry file are bind-mounted into WordPress, so changes are available without rebuilding the containers.
Open:
- Site: https://sticky-block.local
- Admin: https://sticky-block.local/wp-admin
- Credentials:
admin/password
On the first visit, the browser may warn about Caddy's local certificate. Run make caddy-trust once to trust it on the host.
npm run startThe block is compiled to build/ and recompiled on every file change. Activate the plugin in WordPress and the changes are live immediately.
Stop the stack with make dev-stop. To remove the containers and database volume, run make env-reset.
| Command | Description |
|---|---|
make dev |
Start the local WordPress environment |
make caddy-trust |
Trust Caddy's local HTTPS certificate |
make dev-stop |
Stop the Docker services |
make env-reset |
Stop services and remove Docker volumes |
| Command | Description |
|---|---|
npm run start |
Start the dev build watcher |
npm run build |
Production build |
npm run dist |
Production build + plugin zip into dist/ |
npm run lint:js |
Lint JavaScript with ESLint |
npm run lint:css |
Lint SCSS with Stylelint |
npm run format |
Auto-format files |
npm run packages-update |
Update @wordpress/scripts and block dependencies |
├── src/ - block source
│ ├── block.json - block metadata and attributes
│ ├── index.js - block registration
│ ├── edit.js - block editor UI and sidebar controls
│ ├── save.js - saved markup
│ ├── frontend.js - sticky logic (plain JS, no jQuery)
│ ├── editor.scss - editor-only styles
│ └── style.scss - frontend styles
├── build/ - compiled output (committed)
├── docs/ - in-plugin documentation page
├── dist/ - release zip (git-ignored)
├── docker/ - Caddy and WordPress bootstrap configuration
├── docker-compose.yml - local WordPress development stack
├── Makefile - Docker convenience commands
└── wpwing-sticky-block.php - plugin entry point
npm run distThe zip is written to dist/wpwing-sticky-block.zip. It contains only distributable files - no src/, node_modules/, or dev config.