Using content blocks

What is a content block

A Content block in Smartkit is a single block with custom content. You can add any content to the block, including components and shortcodes. Editing and saving blocks is similar to WordPress pages and posts. After creating the block, you can insert it into any area of your site and reuse the block, if necessary.

What are content blocks used for

  1. You can save any content as a block and use it several times in any part of your site.
  2. If you can not use the page builder in some areas (e.g. accordion sections, tabs, text blocks), build a content block and insert it via shortcode.
  3. If the page layout with sidebar or titlebar is required, you should adjust the main layout block.
    The main layout block is a special case of content block. More details here.
  4. If you want to create a hero slider using carousel theme component, you should create the slides first.
    The carousel slides are special cases of content block. More details here.

How to create a content block

Before creating a content block, enable the page builder for the template_post post type
How to enable page builder for custom post types

You can import pre-made content blocks from demo data or create them manually.

  1. Navigate to KSF SmartKit > Content blocks tab in your WordPress admin sidebar and click Add new content block.
  2. Enter the block title (e.g. “My content block”) into the title field.
  3. Add a content to your block using WPBakery Page Builder (see more on how to use the page builder here).
  4. Click on the Publish button.
You can use content blocks in any part of your site.

How to insert the content block

Inserting the block via page buider

  1. Navigate to the editing screen, where you want to insert the content block.
  2. Click on the + button in the WPBakery Page Builder frame.
  3. Search for Content block in the add element pop-up window and click on it to add it.
  4. Choose the block name (“My content block”) from the list and select wrapper HTML-tag in settings window.
  5. Click on the Save changes button.
doc-content-block
You can use content blocks inside other blocks with unlimited nesting.

Inserting the block via shortcode

Navigate to KSF SmartKit > Content blocks tab in your WordPress admin sidebar.
Find the shortcode of the block that you want and copy it.
Now you can insert it into any place of your site.

doc-content-block-shortcode
Using shortcodes you can instert content blocks into accordion, tab, text block and other areas, where you can not use the page builder.
Go back to documentation