LMS Builder

Build your own course inside of Brick Builder. 

[course_navigation]
rbd logo

← How to build a course platform

[lesson_nav_arrows]

[lesson_number_display]

Dynamic Pages with Bricks Builder Conditions

[lesson_backup_reminder url=/reminder threshold=6]
[lessons_completed_arrows arrows=yes]

How to Use Bricks Builder Conditions for Custom Post Types (Dynamic Lesson Pages)

Updated January 2026: This tutorial shows how to attach Bricks templates to custom post types and use Conditions to show or hide sections based on custom field values.

Bricks Builder Conditions are one of the most powerful features in Bricks because they allow you to control what gets shown on a page based on rules. This is especially useful when you’re building course lesson pages using a custom post type (like “Video Classes”).

Instead of creating different templates for every situation, Conditions let you build one strong layout and dynamically show or hide sections depending on what fields are filled out.

Quick Answer: What are Bricks Conditions used for?

Bricks Conditions let you control templates and elements based on rules. You can attach a template to a custom post type, and you can show or hide page sections based on whether a custom field is empty (or not empty). This makes lesson pages more flexible and prevents empty sections from displaying.

Important Note Before You Edit Templates

Please note: I’m not affiliated with Bricks Builder in any way. Also, it’s your responsibility to perform a site backup before making changes to templates or conditions.

Lesson Overview

In this lesson, we take the Bricks lesson template we already built and attach it to our custom post type. Then we add conditions that control which sections appear based on whether custom fields have content.

Main Points

  • Attach a Bricks template to a custom post type
  • Use Bricks Conditions to control visibility
  • Show or hide sections dynamically based on custom fields
  • Hide buttons and sections when fields are empty
  • Reuse the same template for different page types

Refreshed Custom Fields List (Used in This Lesson)

Below is the current custom fields list used for dynamic lesson pages. These fields allow us to build one template and let WordPress populate the layout for each lesson.

Label Field Name Type
Head1 head1 Text
Head2 head2 Text
Content content WYSIWYG Editor
Link1 link1 Link
Linktext1 linktext1 Text
MainPoints mainpoints WYSIWYG Editor
ButtonUrl buttonurl Link

Step-by-Step: Attach a Bricks Template to a Custom Post Type

Step 1: View the Custom Post Page First

Before attaching anything, go to your custom post type and view one of the posts on the front end (example: one of your Video Classes posts).

If you’re seeing only the video content (post content) but not your headings, layout, or custom fields, that’s usually because:

  • Your Bricks template is not attached to that custom post type yet

Step 2: Open the Bricks Template Settings

To attach the template:

  • Open your Bricks template
  • Go to the Settings tab
  • Click Template Settings
  • Open Conditions

Step 3: Add a Template Condition for the Post Type

Add a new template condition such as:

  • Post Type equals Video Classes

Save the template.

Now refresh your custom post page. Your template should display correctly, including all of your Bricks layout sections.

How to Use Bricks Conditions to Hide Empty Sections

Once your template is attached, the next goal is to make the layout smart. In other words, if a custom field is empty, the related section shouldn’t appear on the pag

Lesson Overview

Main Points

√ Attach templates to custom post types
√ Use conditions to control visibility
√ Show or hide sections dynamically
√ Repurpose templates for various content

Lesson Resources

Bricks Conditions (developers site)

Premium Content

Subscribe today for premium content.

[complete_lesson_button]
[lessons_completed_text]
Review Your Cart
0
Add Coupon Code
Subtotal