Skip to main content

Creating an FAQs page - Meta Box + Bricks

In today’s practice, let me show you a way to create an FAQs page using Meta Box and Bricks.

This image below is a specific example:

This is example of the created page

Video version

Preparation

The FAQs Page contains questions and answers that are saved in the custom fields created with Meta Box. They are also displayed in an accordion style on the page.

To do it, we need the tools as follow:

Meta Box core plugin to have the framework for creating custom fields. It’s free, and you can download it directly from wordpress.org.

  • Meta Box Group: to organize custom fields into pairs for questions and answers;
  • Meta Box Builder: to have a UI on the backend to easily create custom fields to save information about the questions and answers;
  • Bricks Builder: to create the FAQs page.

1. Creating a new page

Go to Page > Add New to create a page as usual.

Created a new page

2. Creating custom fields

Go to Meta Box > Custom Fields > Add New. This is the structure of the fields I created:

NameField TypeSettings
FAQs GroupGroupCloneable Collapsible
      QuestionsText-
      AnswerTextarea-

Since each question will go along with the corresponding answer, we have these 2 fields inside a group.

There will be more than one couple of Q&A. So, we’ll set this group as Cloneable to add more questions and answers easily.

Set this group as Cloneable

Then, there’ll be an Add more button to allow adding more Q&A to the FAQs page like this:

Add the add more button

In addition, in case you have many questions and answers, you can set this group as Collapsible.

Tick Collapsible option

Next, you can name the group’s title using some variables as follows. The {#} variable is for numbering the questions and the {question} variable is the ID of the question field to display the content of that question.

Name the group’s title

Naming like this will help you identify the set of Q&A more easily and avoid being messy.

Naming will help you identify the set of Q&A

After creating all the fields, move to the Settings tab, and choose Location as Page. Since we created the fields for the FAQs page, go to the Advanced location rules section below and choose the FAQ which is the name of the page.

Set location and advanced location rules for the created field

Then, you can easily see all the fields in the page editor. Just fill in the Q&A now.

Created field in the post editor

3. Editing the page

Still in the page editor, go to Edit with Bricks.

First, select the Section element to contain all content of the page.

Select the Section element

Next, add a Post Title element to get the title of the page.

Add a Post Title element

Inside the Container, to show or hide the pairs of questions and answers for detailed information easily, let’s add the accordion. But, instead of using the Accordion element, I choose the Accordion (Nestable) one so that I can add elements inside it.

Choose the Accordion (Nestable)

Normally, you can use each item here for a pair of questions and answers. The Title will be the question, and the Content will be the answer. The number of items will be the same as the number of the pairs. However, we saved the question and answer in a cloneable group, so you only need one item in the accordion and remove the others.

Delete one item

Next, enable the query loop for the item. In the Type of the query settings, choose the created group field. Then, the number of displayed accordions will be the same as the number of questions.

Choose the Select dynamic data button and find the created group field

To show the question, go to the Heading element, choose Select dynamic data button, then search for the Question field.

Choose the Select dynamic data button and find the question field

For the answer, move to the Rich Text element. Choose Select dynamic data button, and the corresponding field as well.

Choose the Select dynamic data button and find the corresponding field

Then, you will see all the information displayed like this.

The information is displayed

For styling the page, still in the page editor with Bricks, you can style each element by changing their settings.

Then you will see the new look of the page.

The final result