Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dee-webtech/service-grid-block/archive/refs/heads/main.zipA lightweight WordPress plugin that registers a "Services" custom post type and a dynamic Gutenberg block to display them in a configurable, responsive grid — no page builder required.
Why I created this plugin
Small business sites often need an editable list of services (a salon, an agency, a repair shop) without the overhead of a page builder or a hardcoded template. This plugin gives editors a native block that pulls live data from a dedicated post type, so services can be added, updated, or removed at any time without ever touching a template file — the display always reflects what's currently published, not a snapshot frozen at the moment the page was last saved.
Features
- "Services" custom post type (title, body, excerpt, featured image)
- Dynamic Gutenberg block with adjustable Columns (1–4), Number of services, and Order by
- Live editor preview identical to the front-end output
- Equal-height responsive cards that collapse to one column on mobile
- Built-in, WP_DEBUG-gated debug logging for troubleshooting
Requirements
- WordPress 6.3+
- PHP 7.4+
- Node.js 18+ and npm (only needed if editing the source in
/src)
Installation
- Copy this folder into
wp-content/plugins/. - Activate "Service Grid Block" from the Plugins screen.
- Go to Services → Add New and create a few services.
- Insert the "Service Grid" block on any page and adjust its settings.
Editing the source
The /build folder is compiled and ready to run — that's what WordPress
loads. To change behavior or styling, edit files in /src, then rebuild:
npm install
npm run build
Debugging
Add to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
With debug mode on, every render logs its query parameters and result count
to wp-content/debug.log, and an HTML comment with the same details appears
in the page source — useful for confirming what the block queried without
opening any files.
Architecture notes
- Built as a dynamic block (server-rendered via
render.php) rather than a static block, because the Services list changes independently of when a page was last saved. - Uses
ServerSideRenderin the editor so the preview and the live front end always run the exact same PHP — editor and front end can never drift apart. - Attributes are re-sanitized inside
render.phpitself, regardless of the types declared inblock.json, since that schema is an editor-side contract, not a server-side guarantee.
License
GPL v2 or later