How to Assign Certain FAQs to Specific Posts using ACPT and Bricks

  • ACPT

Learn how to assign specific FAQs to individual posts using ACPT and Bricks Page Builder in WordPress. This step-by-step guide will show you how to link related FAQs to your posts dynamically, ensuring only relevant FAQs are displayed. Perfect for organizing FAQs for properties, products, or any custom post type

In this tutorial, we’ll learn how to assign specific FAQs to show only for certain posts. For example, let’s say you have a Properties CPT with two types of properties: for sale and for rent. You want to display FAQs related to property sales only for properties listed for sale, and FAQs related to property rentals only for properties listed for rent. While this concept can be applied to many use cases, this tutorial will focus on this specific example to guide you step by step.

Creating Custom Post Type

First, we’ll need to create two custom post types: one for Properties Listing and another for FAQs. This will help us organize our property listings and FAQs separately, making everything more structured and easier to manage. If you’re new to creating custom fields, check out our tutorial: How to Create a Custom Post Type Using ACPT. It will guide you through the process step by step.

A web interface showing registered custom post types with options to view, edit, duplicate, delete, export code, and manage permissions. Two entries are highlighted with red borders.
FAQ And Properties Custom Post Type

Creating Custom Fields

After creating the custom post types, we’ll also need to set up custom fields for both the Properties and FAQ custom posts. If you’re unsure how to create custom field groups or add fields, take a look at our tutorial on Creating Custom Fields for a detailed guide.

Screenshot of ACPT interface displaying a field group. Includes options for adding fields, editing, and managing actions with buttons for save and delete.
Custom Fields for FAQ CPT
Screenshot of a property-field groups management page with various property details like size, floor, and price. Highlighted row includes "Related FAQ" with settings and action icons.
Custom Fields for Properties CPT

For the Properties CPT, we’ll need to add a Post (Multiple) Field. This is because we want to link multiple FAQs to each property on its single page.

Here’s how to do it:

  1. Add a new field and label it Related FAQ.
  2. Choose the Post (Multiple) Field type.
  3. Click on Advanced Options to specify which posts you want to fetch data from, set the post status, and configure other settings as needed.
Screenshot of an admin panel's form interface showing options for configuring fields, including related FAQs and field slugs with sections for permissions and logic.
Post Object Basic Options
Screenshot of an advanced options menu in a software interface. Options include headline location, vertical alignment, field width, field layout, and filters by post type, status, and taxonomy.
Post object Advance settings

Configure how posts are filtered and displayed in the dropdown/selector:

  • Field Layout:
    • OptionOnly name or title
    • Displays posts by their titles only (alternative: show featured images with title).
  • Filter by Post Type:
    • OptionFAQs
    • Restrict selectable posts to the “FAQs” post type.
  • Filter by Post Status:
    • OptionPublish
    • Only show published posts (exclude drafts or private posts).
  • Filter by Taxonomy:
    • OptionSelect
    • Filter posts by a taxonomy (e.g., only show FAQs tagged “Rent”).
    • Note: You must first define the taxonomy and assign terms to posts.

After you create your custom fields and save everything, when you populate your custom post type (CPT) and want to add properties, your screen should look like the image shown below. Also, your post object should only display the FAQ that is published. This happens because we set our filter to show only published FAQs.

Screenshot of a WordPress property listing edit page showing details for a villa, including images, property info, and agency links.
Property CPT Editor Interface with Custom Fields
Screenshot of a FAQ dropdown menu with questions about buying property.
FAQ Post Object Dropdown

Now that you’ve completed all these steps, simply choose the FAQs that you want to add to that specific property and save your changes.

Displaying on the Frontend

To display your single property and show these related FAQs, go to Bricks > Templates and create a new template. Next, select ‘Single’ as the template type. After that, click ‘Edit with Bricks’ to design the layout you want for your single property.

Screenshot of a website editor interface showing a Frequently Asked Question section. A world map preview is visible, alongside editing tools and options for styling and properties.
Querying Related FAQ Field

After you design your layout, you should query the outer wrapper of your FAQ and connect it to your related FAQ post object custom field. Then we will use the dynamic values of our questions and answers since we use the FAQ’s for a custom post type (FAQ CPT) we use the questions as How to Assign Certain FAQs to Specific Posts using ACPT and Bricks and the answer as a custom field of {acpt_faq_faq-metabox_answer}.

Then, save the changes. Now, go to your properties and assign your related FAQ to each property listing you have. After that, check the frontend. Each property should now display the questions and answers you assigned by using the FAQ post object.

Using Conditional Logic

If no related FAQ is set, all FAQs will be shown. This ensures that our design stays intact and that each property will have FAQs, even if you or your client forget to add a related FAQ to a specific property.

First, duplicate the FAQ layout so you will have two FAQs showing on the page. Then, go to the one that has the related FAQ’s query parameters. Click on ‘Conditions’ to add a new condition.

Screenshot of a website editing interface displaying an FAQ section with "Frequently Asked Question" text. Dynamic data and conditions are shown on the left sidebar.
Related FAQ’s Condition

Next, we will configure the All FAQ’s condition. This condition will ensure that even if a related FAQ is not assigned, the property will still display FAQs, keeping the design consistent and functional.

Screenshot of a webpage editor displaying sections for "Frequently Asked Questions" with options for dynamic data and input properties. The page footer contains links and copyright information.
All FAQ Condition Logic

After you have set all of this up, everything should now work as expected. If a property has assigned Related FAQs, only those specific FAQs will be displayed. If no Related FAQs are assigned, then all the FAQs will be shown. This ensures that every property will have FAQs, whether or not specific ones are assigned.

Method (2)

In this section, we’ll explore an alternative method to approach the task. While the previous strategy works well in many cases, one of our ACPT community members highlighted a potential limitation: if you’re managing a large number of properties or a lengthy list of FAQs, the original approach might become less efficient over time.

Creating A Many-to-Many Bidirectional Relationship

Let’s start by setting up the foundation for this method. Here, we’ll create a many-to-many bidirectional relationship field to link FAQs CPT and Properties CPT. This setup allows you to assign FAQs to Properties while editing or creating either one giving you flexibility to manage connections in both directions.

FAQ Field Group

Head over to your Field Groups section, this is where all your custom fields are organized. From the list, identify and select the field group that’s linked to your FAQs 

Screenshot of the ACPT interface showing field groups list. FAQ Field Groups are highlighted in red, with options to edit or duplicate. Other groups include agency and property field groups.
Editing FAQ Field Group

Once you’ve found it, click Edit to open its settings. This step is crucial because editing the correct field group ensures that any changes you make (like adding or adjusting fields) will automatically apply to all instances where this group is used.

Admin interface showing settings for a form field. Options include field label, slug, type, and description. There are tabs for advanced options, conditional logic, validation rules, and permissions.
  1. Add a New Field:
    • In your FAQ field group, click Add Field.
    • Choose any field type because ACPT needs two fields in different field groups that you want to connect. This is important for setting up your bidirectional relationship fields properly (I used a text field)
  2. Label It Clearly:
    • Name the field something intuitive like “Related Properties”. This label will appear when editing FAQs and will use when we are querying in bricks UI.

After that, make sure to save your changes.

Property Field Group

We’ve built the first half of our bidirectional relationship field. Now, let’s complete the puzzle by creating the second required field in ACPT. This field will act as the ‘counterpart’ to the one we just made, ensuring FAQs and Properties can communicate.

Screenshot of a web interface showing a table with field groups. The "property-field-groups" row is highlighted with a red box. The interface includes options like Edit and Duplicate.
  1. Navigate to Properties Field Groups:
    • Head to the field group tied to Properties (Property field groups), Once you’ve found it, click Edit to open its settings
    • Click Add Field and choose Relationship Field. This tells ACPT you’re creating a field to link entities (FAQs ↔ Properties).
Screenshot of an interface for configuring related FAQs. It shows options for field label, slug, field type, and relationship settings, with tabs for advanced options and conditions.

Name this field something like “Related FAQs” to mirror the “Related Properties” field we created earlier. Consistency here makes the connection obvious.

Then under RELATED ENTITIES AND RELATIONSHIP, locate the “From” dropdown select Properties entity (the entity you’re currently editing). This defines where the relationship originates. Since we’re editing the Properties field group, the relationship starts here (Properties → FAQs).

then “To” dropdown select Select FAQs from the list. This defines what you’re linking to. Here, you’re connecting Properties (source) to FAQs (target).

Locate the Relationship dropdown, and select Many to Many – Bidirectional

Why This Matters:

  • Many-to-Many: A single Property can link to multiple FAQs, and a single FAQ can link to multiple Properties.
  • Bidirectional: Changes made on either side (Property or FAQ) automatically update the other.

Then at the “target file, select field box from the list” you will need to choose the metabox that is associated with the field we created in the FAQ field group FAQ Metabox

Locate the Target Field dropdown under the relationship settings. Then Select related-property (the existing relationship field in the FAQ entity).

Next, save the changes. Then, go and check the FAQ custom post type and the Properties CPT. The relationship field should be there and displayed as shown in the picture below.

FAQ interface showing search bar and selected items about property buying, including considerations, steps, and special offers for first-time buyers.
Properties Related FAQ displays all FAQs and the assigned one on the right.
A webpage interface showing the "related property" settings with search options and selected items. Sidebar includes menu options like FAQs, Media, and Pages.
FAQ CPT and the related properties

Displaying on the frontend

Now that we’ve set up our many-to-many bidirectional relationship, let’s display it on the frontend. First, design your properties single layout using the method mentioned above. Then, decide where you want to add the FAQ section.

To query the relationship field, click on the FAQ wrapper and toggle on the query option. After that, select the appropriate query field.

Screenshot of a webpage editor UI with a FAQ section open, showing code snippets for dynamic titles and toggles. The interface includes menus, style options, and a preview of the webpage footer.
Query Related FAQs in the Single Properties Template

In the query parameters, you’ll see [properties]-properties-metabox related-faqs and [faq]-faq-metabox related-property. These are the two fields we created and linked, and they function differently. If you’re in the properties template and want to query the relationship field, choose the first one. If you’re on the FAQ’s single page, select the second one.

While it may not be necessary to display the FAQ single page and its related properties in this case, you can do so if needed. However, it’s important to remember this for other use cases.

ACPT Version : 2.0.20

LogoCreated with Sketch.

Bricks Version : 1.12.1

If you haven't purchased ACPT yet and are planning to, we'd appreciate it if you use our affiliate link. It costs you nothing extra and helps us continue to deliver quality content. if you already have ACPT And this tutorial helped you Buy Me A Coffee