humanmade / post-template-table
A post template like block to output posts as a table
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/humanmade/post-template-table
Requires
- composer/installers: ^1 || ^2
README
A WordPress block plugin that provides a table-based alternative to the core/post-template
block for displaying query results.
Features
- Table Layout: Display query loop posts in a structured table format
- Sortable Columns: Reorder columns using up/down arrows in the sidebar
- Editable Headers: Customize column header labels
- Toggle Headers: Option to show/hide the header row
- Core Block Support: Works with standard WordPress post blocks:
core/post-title
core/post-date
core/post-excerpt
core/post-featured-image
core/post-terms
core/post-author
core/post-author-name
core/post-author-biography
core/avatar
Installation
- Copy this plugin folder to your WordPress
wp-content/plugins/
directory - Navigate to the plugin directory:
cd wp-content/plugins/hm-post-template-table
- Install dependencies:
npm install
- Build the plugin:
npm run build
- Activate the plugin in WordPress admin
Usage
- Add a Query Loop block to your page/post
- Inside the Query Loop, add the Post Template Table block
- Add post blocks (e.g., Post Title, Post Date) as children to create columns
- Customize column headers in the block sidebar
- Reorder columns using the up/down arrows
- Toggle the header row visibility if needed
Development
Build Commands
npm run start
- Start development mode with hot reloadnpm run build
- Build production-ready assetsnpm run lint:js
- Lint JavaScript filesnpm run lint:css
- Lint CSS/SCSS filesnpm run format
- Format code using WordPress standards
Block Structure
The block must be used as a child of core/query
(Query Loop block). It renders a table where:
- Each inner block becomes a column
- Each post in the query becomes a row
- Headers are customizable via block attributes
Requirements
- WordPress 6.0 or higher
- PHP 7.4 or higher
- Node.js for development
License
GPL-2.0-or-later