How to Create an FAQs Page - P1 - Using Meta Box and Elementor
Tags: customfield, faqpage, elementor, tutorial
Published: 2022-10-25 02:41:06

Having an FAQs page</strong> on your site will help the visitors to find the information they want easily. This also leads to a higher SEO ranking owing to the better user experience. There is an easy way to add questions and answers using custom fields. So, in this practice, we're going to add FAQs to a page using <strong>Meta Box</strong>. And, we'll use <strong>Elementor</strong> to build the page.

<!--more-->

This is the example page:

<img class="aligncenter" src="https://i.imgur.com/sjpQ1l7.png" alt="Example of an FAQs page" width="1000" height="678" />

<h2>Video Version</h2>

https://youtu.be/nGTT2Vl_t1U

<h2>Before Getting Started</h2>

To get started, we need the <a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a> to have the framework for creating custom fields. It's free, and you can download it directly from <a href="https://wordpress.org/plugins/mb-custom-post-type/">wordpress.org</a>.

For the advanced features from Meta Box, we need some of its extensions:

<ul>

   <li><a href="https://metabox.io/plugins/meta-box-group/">Meta Box Group</a>: to organize custom fields into robust and intensely user-friendly groups;</li>

   <li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li>

   <li><a href="https://metabox.io/plugins/mb-elementor-integrator/">Meta Box - Elementor Integrator</a>: to connect and display data from custom fields created by Meta Box plugin in the Elementor's dynamic tags.</li>

</ul>

They're all in the <strong>Meta Box AIO</strong>. If you haven't had it, you can download and install each one individually.

Finally, make sure you have <strong>Elementor</strong> <strong>Pro</strong> on your site.

<h2>Step 1: Create a New Page</h2>

Go to <strong>Pages</strong> &gt; <strong>Add New</strong>.

<img class="aligncenter" src="https://i.imgur.com/1StiUwk.png" alt="Create a new page" width="1000" height="286" />

Let's create custom fields for this page in the next step.

<h2>Step 2: Create Custom Fields</h2>

Go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong>. This is the structure of the fields that I created:

<table>

<tbody>

<tr>

<td><b>Name</b></td>

<td><b>Field Type</b></td>

<td><b>Settings</b></td>

</tr>

<tr>

<td><span style="font-weight: 400;">FAQs Group</span></td>

<td><span style="font-weight: 400;">Group</span></td>

<td>

<ul>

   <li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Cloneable</span></li>

   <li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Collapsible</span></li>

</ul>

</td>

</tr>

<tr>

<td><span style="font-weight: 400;">       Questions</span></td>

<td><span style="font-weight: 400;">Text</span></td>

<td><span style="font-weight: 400;">-</span></td>

</tr>

<tr>

<td><span style="font-weight: 400;">       Answer</span></td>

<td><span style="font-weight: 400;">WYSIWYG</span></td>

<td><span style="font-weight: 400;">-</span></td>

</tr>

</tbody>

</table>

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

There also will be more than one couple of Q&amp;A. So, we'll set this group to be cloneable to easily add more questions and answers.

<img class="aligncenter" src="https://i.imgur.com/2B95tfC.png" alt="Set group as cloneable to add more questions and answers easily" width="1000" height="759" />

Then, there'll be an <strong>Add More</strong> button to allow adding more Q&amp;A to the FAQs page like this.

<img class="aligncenter" src="https://i.imgur.com/zn6ljsx.png" alt="Adding more options to the page with Add more button" width="1000" height="665" />

In the event that there are too many questions and answers on the page, you can set this group to be collapsible.

<img class="aligncenter" src="https://i.imgur.com/2W0m7B3.png" alt="Set the group to be collapsible to display the Q&amp;A in a tidy way" width="1000" height="578" />

It'll help avoid being messy.

<img class="aligncenter" src="https://i.imgur.com/UHecgu8.png" alt="Fields display the Q&amp;A in a tidy way" width="1000" height="473" />

After creating all the fields, move to the <strong>Settings tab</strong>, choose <strong>Location</strong> as <strong>Page</strong> and select <strong>FAQ</strong>. Since we created the fields for the FAQs page, go to the <strong>Advanced location rules</strong> section below and choose the <strong>FAQ</strong>.

<img class="aligncenter" src="https://i.imgur.com/emaEfTi.png" alt="Set location for FAQs page " width="1000" height="330" />

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

<img class="aligncenter" src="https://i.imgur.com/DqQ2lHz.png" alt="The page with created custom fields " width="1004" height="730" />

<h2>Step 3: Create a Skin</h2>

If you don't use a cloneable field, you can get the data as usual, all of them will be displayed with the same style. But in this case, I used a cloneable field and was willing to have a different style for the questions and answers. So, I'll create a skin to do it easily.

Go to <strong>Templates</strong> &gt; <strong>Theme Builder</strong> &gt; <strong>Meta Box Group Skin</strong> &gt; <strong>Add New</strong> to create a new skin.

<img class="aligncenter" src="https://i.imgur.com/UGJOh3h.png" alt="Create a skin in Template from the Menu Dashboard" width="1000" height="461" />

<img class="aligncenter" src="https://i.imgur.com/bFZjnQZ.png" alt="Click Add New for new skin to appear in the Meta Box groups skin" width="1000" height="390" />

Remember to set the preview for the skin.

<img class="aligncenter" src="https://i.imgur.com/MisYHIc.png" alt="Set the preview for the skin" width="1003" height="358" />

Then, add a <strong>Heading</strong> element for the questions.

<img class="aligncenter" src="https://i.imgur.com/v6KL4iO.png" alt="Add a Heading element" width="1000" height="367" />

To get the information of the question saved in custom fields, click the <strong>Dynamic</strong> <strong>Tags</strong> button in the settings of the <strong>Heading</strong> element. There's a list of options. Choose <strong>Meta Box Field</strong> in the <strong>Post</strong> section.

<img class="aligncenter" src="https://i.imgur.com/t0i8CjF.png" alt="Get the information as answers that save in MB custom fields" width="1003" height="367" />

Then, choose the name of the field you want to get data from. In my case, it's <strong>Question</strong>.

<img class="aligncenter" src="https://i.imgur.com/0QQbvwK.png" alt="Choose the name of the wanted field to get data " width="1000" height="465" />

For the answer of the corresponding question, add the <strong>Text</strong> <strong>Editor</strong> element. Then, also use the <strong>Dynamic</strong> <strong>Tags</strong> button &gt; <strong>Meta</strong> <strong>Box</strong> <strong>Fields</strong> in the <strong>Post</strong> section and choose the <strong>Answer</strong> fields.

<img class="aligncenter" src="https://i.imgur.com/nbwMXmw.png" alt="Choose Text Editor element for the answer of the corresponding questions created " width="1000" height="465" />

Now, both the question and answer have been obtained already. As you can see, it'll automatically get and display the information saved in the first group (means the 1st question and answer) only for the preview.

Since this skin will be applied for the FAQs page, remember to add a condition when publishing it.

<img class="aligncenter" src="https://i.imgur.com/M1jOCwQ.png" alt="Add a condition when publishing " width="1000" height="529" />

<h2>Step 4: Apply the Skin to the Page</h2>

Let's edit the FAQs page with Elementor.

<img class="aligncenter" src="https://i.imgur.com/w57xWhG.png" alt="Edit the FAQs page with Elementor." width="1000" height="354" />

Since all the information of the Q&amp;A is saved in a cloneable group with subfields, add the <strong>Meta Box Group</strong> element to get the data from that group.

<img class="aligncenter" src="https://i.imgur.com/6BXDc6m.png" alt="Add the Meta Box Group element to get the data" width="1000" height="377" />

Then, there'll be some data displayed in the preview. However, it may not be the information correctly as you want. Make sure the settings in the left sidebar are the ones we need as follows.

<img class="aligncenter" src="https://i.imgur.com/XsfnVfl.png" alt="Set options in the left side bar to match the information with the previews" width="1003" height="372" />

The <strong>Object Type</strong> of the template will have 2 options are <strong>Post</strong> and <strong>Settings</strong> <strong>page</strong>. If your custom fields are applied for a post type or page, choose the Post option. In the event that your custom fields are for a settings page, choose another one. So in this case, we choose the <strong>Post</strong> option.

It will be automatically set as the created-latest group in the <strong>Group</strong> section. If it is not the group field you want, you can change them to the right one.

Then all the data will be displayed correctly, but there is no styling.

For styling, choose the skin that you've created in the <strong>Skin</strong> section. Then, it will turn to the new look with the style of the created skin.

<img class="aligncenter" src="https://i.imgur.com/p655vfl.png" alt="Choose the skin created" width="1000" height="512" />

Now, all the questions and answers have been shown with different styles.

<img class="aligncenter" src="https://i.imgur.com/IVCVx89.png" alt="Q&amp;A shows with different style" width="1000" height="660" />

Since the element which is the question and answer are set in the skin, you need to go back to the created skin to style it if you want to have more advanced styling.

<img class="aligncenter" src="https://i.imgur.com/wle2LFn.png" alt="Back to the created skin to style" width="1000" height="464" />

Then all the changes in the skin will be automatically applied for the page.

<img class="aligncenter" src="https://i.imgur.com/sjpQ1l7.png" alt="FAQs Page after apply the skin" width="1000" height="678" />

<h2>Last Words</h2>

We've gone through some simple steps to create an FAQs page. Do you see that using custom fields to create an FAQs page is an easy way? If you see this practice is helpful, try it and share the result with us.

If you're using other page builders, wait for our upcoming tutorials. Keep track of our blog and good luck!