Create Block
Lazy Blocks allows you to create custom blocks with HTML or PHP output. You can build blocks for content display or create custom meta fields that can be accessed in your theme code. This guide will walk you through the block creation process.
Getting Started
-
Navigate to WordPress Admin → Lazy Blocks
-
Click Add New button
Block Builder
Main Section
Controls
Configure the options available in your block. Controls determine what users can customize when using your block. Learn more about controls
Code Output
Choose between PHP or HTML + Handlebars syntax to determine how your block displays. See detailed code documentation
- Frontend - The code that displays on your live site
- Editor - The preview shown in the block editor
- Single output code - Use the same code for both frontend and editor
- Output Method - Choose between HTML + Handlebars or PHP
- Editor preview - Control when the block preview appears
- Native block style - Remove the frame border in editor
Leave the Frontend code empty if you're creating a block purely for meta fields.
Secondary Section
- Title - The block's name in the inserter
- Collection & Namespace - Group and organize your blocks
- Slug - Unique identifier (lowercase letters, numbers, and dashes only)
- Description - Brief explanation shown in the inspector
- Icon - Dashicon to represent your block
- Category - Group your block with similar blocks
- Keywords - Search terms (max 3) to help users find your block
- Styles - Alternative visual styles
- Supports
- Multiple - Allow multiple instances per page
- Class Name - Enable custom CSS classes
- Anchor - Add ID attribute support
- Inserter - Show in blocks inserter
- Reusable - Allow conversion to reusable block
- Lock - Enable block locking
- Align - Add alignment options
- Supports Ghost Kit - Enable Ghost Kit compatibility
- Condition - Restrict block to specific post types. If no post types selected, the block will be shown everywhere