Blog · Gutenberg

Category Grid block for WordPress

Display WordPress post categories in a responsive grid with post counts, icons, descriptions, and rich styling options.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display WordPress post categories in a responsive grid with post counts, icons, descriptions, and rich styling options.

Inspector panels on this block: Query, Layout, Content, Card Style, Color Mode. Those titles come from index.js, not from a shared template.

Behavior controls: “Order By” options: Post Count, Name (A–Z), ID, Slug; “Order” options: Descending, Ascending; “Card Style” options: Card (shadow), Card with accent bar, Icon circle, Minimal (no background); “Icon Position” options: Top, Left (inline).

Where to find it

Gutenberg inserter → Blog → search “Category Grid” (block name `blockenberg/category-grid` in block.json). Style it in the sidebar after insert.

How to use Category Grid block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Category Grid”, insert it. Category: Blog.
  3. Configure inspector controls that exist on this block. Open Query. Set “Max Categories”, “Order By”, “Order”, “Hide Empty Categories”.
  4. Check the published page. The view script reads HTML data attributes: data-accent, data-animate, data-bg-hover, data-border-color, data-card-bg, data-card-bg-hover, data-card-border, data-card-padding. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Max CategoriesNumeric range control in the inspector. Range 1–50. block.json default: 9. Saved as `maxCategories`.
Order BySelect control; the chosen value is saved on the block. Options: Post Count; Name (A–Z); ID; Slug. block.json default: count. Saved as `orderBy`.
OrderSelect control; the chosen value is saved on the block. Options: Descending; Ascending. block.json default: desc. Saved as `order`.
Hide Empty CategoriesOn/off toggle in the inspector. On by default. Saved as `hideEmpty`.
Include IDs (comma-separated)Text field in the inspector. Saved as `includeIds`.
Exclude IDs (comma-separated)Text field in the inspector. Saved as `excludeIds`.
ColumnsNumeric range control in the inspector. Range 1–6. block.json default: 3. Saved as `columns`.
Gap (px)Numeric range control in the inspector. Range 0–48. block.json default: 16. Saved as `gap`.
Card StyleSelect control; the chosen value is saved on the block. Options: Card (shadow); Card with accent bar; Icon circle; Minimal (no background). block.json default: card. Saved as `cardStyle`.
Icon PositionSelect control; the chosen value is saved on the block. Options: Top; Left (inline). block.json default: top. Saved as `iconPosition`.
Text AlignSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `textAlign`.
Link TargetSelect control; the chosen value is saved on the block. Options: Same tab; New tab. block.json default: _self. Saved as `linkTarget`.
Show Icon / EmojiOn/off toggle in the inspector. On by default. Saved as `showIcon`.
Icon Size (px)Numeric range control in the inspector. Range 16–80. block.json default: 36. Saved as `iconSize`.
Show Post CountOn/off toggle in the inspector. On by default. Saved as `showCount`.
Count LabelText field in the inspector. block.json default: posts. Saved as `countLabel`.
Show DescriptionOn/off toggle in the inspector. Off by default. Saved as `showDescription`.
Max Description LengthNumeric range control in the inspector. Range 20–200. block.json default: 80. Saved as `maxDescriptionLength`.
Show Arrow →On/off toggle in the inspector. On by default. Saved as `showArrow`.
Animate on HoverOn/off toggle in the inspector. On by default. Saved as `animateOnHover`.
Border Radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 12. Saved as `cardRadius`.
Padding (px)Numeric range control in the inspector. Range 8–60. block.json default: 24. Saved as `cardPadding`.
Show ShadowOn/off toggle in the inspector. On by default. Saved as `cardShadow`.
Show BorderOn/off toggle in the inspector. Off by default. Saved as `cardBorder`.
Color ModeSelect control; the chosen value is saved on the block. Options: Single accent; Multi-color. block.json default: single. Saved as `colorMode`.
Card BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `cardBg`.
Card Hover BackgroundColor control in the inspector. block.json default: #f5f3ff. Saved as `cardBgHover`.
AccentColor control in the inspector. block.json default: #6c3fb5. Saved as `accentColor`.
Name TextColor control in the inspector. block.json default: #1e1e1e. Saved as `nameColor`.
Post Count BadgeColor control in the inspector. block.json default: #6c3fb5. Saved as `countColor`.
Count Badge BgColor control in the inspector. block.json default: #ede9fe. Saved as `countBg`.
DescriptionColor control in the inspector. block.json default: #6b7280. Saved as `descColor`.
Card BorderColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Category Grid block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Category Grid”. It sits under Blog. After insert, open Query and set “Max Categories”, “Order By”, “Order”, “Hide Empty Categories”.

What makes Category Grid different from other Blockenberg blocks?

Display WordPress post categories in a responsive grid with post counts, icons, descriptions, and rich styling options. Inspector labels on this block include “Max Categories”, “Order By”, “Order”, “Hide Empty Categories”.

Is the Category Grid Gutenberg block free?

Yes. Category Grid ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Category Grid to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Query, Layout, Content, Card Style).

Related blog blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Category Grid from the Gutenberg inserter.

Get Blockenberg