Quick Start Guide
This guide walks you through creating a simple “Feature Card” block from start to finish.
Step 1: Create a New Block
Section titled “Step 1: Create a New Block”-
In your WordPress admin, go to WPBits Block Studio
-
Click Add New Block
-
Fill in the block details:
- Namespace:
myplugin(your plugin/theme prefix) - Block Name:
feature-card - Block Title:
Feature Card - Description:
A card component for displaying features
- Namespace:
-
Click Create Block
Step 2: Add Attributes
Section titled “Step 2: Add Attributes”Attributes define the data your block stores. For a feature card:
Title Attribute
Section titled “Title Attribute”- Click + Add Attribute
- Set Name:
title - Set Control:
text
Description Attribute
Section titled “Description Attribute”- Click + Add Attribute
- Set Name:
description - Set Control:
textarea
Icon Attribute
Section titled “Icon Attribute”- Click + Add Attribute
- Set Name:
icon - Set Control:
image
Step 3: Configure Block Settings
Section titled “Step 3: Configure Block Settings”Block Supports
Section titled “Block Supports”- Click the Block Supports tab
- Enable options like:
align(wide align)color(text and background)
Location Rules
Section titled “Location Rules”- Click the Location Rules tab
- Set where your block should appear
Step 4: Design the Template
Section titled “Step 4: Design the Template”WPBits Block Studio generates a default template file. You can customize it:
<div class="feature-card"> {% if attributes.icon %} <img src="{{ attributes.icon }}" alt=""> {% endif %} <h3>{{ attributes.title }}</h3> <p>{{ attributes.description }}</p></div>Step 5: Use Your Block
Section titled “Step 5: Use Your Block”- Open any page/post in the WordPress editor
- Click the + block inserter
- Search for “Feature Card”
- Click to add the block
- Edit the title, description, and icon
Control Types Reference
Section titled “Control Types Reference”WPBits Block Studio provides 20 control types:
| Category | Controls |
|---|---|
| Text | text, textarea, rich-text |
| Number | number, range |
| Selection | toggle, checkbox, select, multi-select, combobox, radio |
| Media | color, image |
| Date/Time | date, datetime, time |
| Advanced | link, unit |
| Pro | repeater, post-selector |
What’s Next?
Section titled “What’s Next?”- Control Types — Learn all 20 control types
- Creating Blocks — More details on block creation
- Twig Templates — Master Twig templates