How to Use the Gutenberg Block
A WordPress gallery block lets you insert a gallery into any post or page without a shortcode. The WP Social Media Gallery block appears in the inserter under the WP Social Media Gallery category. Pick a saved gallery from the block settings and the front end renders it automatically.
Before You Start
Make sure you have at least one saved gallery before inserting the block.
- WP Social Media Gallery installed and activated.
- At least one gallery created in the Gallery Builder.
- A post or page open in the block editor.
Insert the Block
- Open any post or page in the block editor.
- Click the + button to open the inserter.
- Search for WP Social Media Gallery or browse the WP Social Media Gallery category.
- Click the WP Social Media Gallery block to insert it.
The block appears in the content area with a placeholder that reads “Select a gallery.”
Select a Gallery
With the block selected, open the block settings sidebar on the right. Under Gallery, choose the gallery you want to display from the dropdown. The block shows a live preview of the selected gallery’s layout and images.
- Click the WP Social Media Gallery block in the editor.
- In the settings sidebar, open the Gallery dropdown.
- Select the gallery you want to embed.
The block updates its preview instantly. If you change the gallery in the builder later, the block reflects the new content automatically because it references the gallery by ID.
Preview and Publish
The block shows a preview inside the editor, but you should also preview the published page to confirm the lightbox, layout, and responsive behaviour work as expected.
- Click Preview in the editor toolbar.
- Confirm the gallery renders with the correct layout and images.
- Click Publish or Update to make the page live.
The block stores only the gallery ID in post content. All gallery data — images, layout, lightbox settings — lives in the wp_ccpwpsmg_galleries table and is loaded dynamically on the front end.
What to Check
Confirm the block works correctly after publishing.
- The gallery renders with the layout you selected in the builder.
- Clicking an image opens the lightbox with navigation arrows.
- The block remains editable — changing the gallery in the dropdown updates the front end.
- The gallery is listed in WP Social Media Gallery > Gallery Builder.
Troubleshooting
If the block shows a blank or an error, check the following.
- No galleries in the dropdown: Create at least one gallery in the Gallery Builder first. The block dropdown is populated from saved galleries only.
- Block shows a placeholder after selecting: Confirm the gallery status is active in the builder. An inactive gallery does not render.
- Lightbox does not open: Verify the lightbox is enabled in the gallery’s Configuration or Lightbox step.
Next Steps
The block is one of two ways to embed galleries. The other is the shortcode, which gives you more control over attributes. Read the WP Social Media Gallery shortcode reference to learn when to use each method.