If you are wondering about what an FAQs page is, we will explain it very shortly for you. F.A.Q stands for Frequently Ask Question, so an FAQs page is a page that helps people quickly and directly address the most common questions about your product.  FAQs page is so integral because it not only solves the customer’s problem but also boosts the relationship between you and your users.

Especially, when you use a WordPress website, you should know the method to create a custom FAQs page. There are many ways to do it, and in this post, we will share with you one of the most helpful ways by using the Meta Box plugin.

Before We Start

Install the Required Plugins

To have the Meta Box Framework that you have to use throughout this tutorial, you need to download the Meta Box plugin first. This is very essential as it gives you the basement for creating a FAQs page. If this is the first time you have tried this plugin, you can refer to this post.

Meta Box plugin (the framework) is free, but in the Meta Box package, we need to use the 2 paid extensions for this purpose, which are Meta Box Group and Meta Box Builder. It’s so convenient that you can purchase only these premium plugins in the Meta Box package or buy the whole package to save money. Otherwise, you can use the Online Generator tool instead of Meta Box Builder. They both help you create custom fields easily with an intuitive UI, but Online Generator is free.

After having them, don’t forget to upload them to WordPress’s plugin directory and activate them.

Prepare a Template for the FAQs Page

Apparently, a page layout is a must for every kind of page, not this page only. If you are a coder, that’s good! You can design and built it yourself. Otherwise, free HTML on the Internet is available.

I used Nav Tabs of the Bootstrap 4 library to create this template. I will use it for this guideline post.

Prepare a Template for the FAQs Page

Detailed Instructions

Create a New Page for FAQs

Step 1: Create a Template

Copy the template to the theme folder of WordPress. You can place it into “template-parts” or “theme” as long as it’s convenient for you to manage, develop, and fix it. In my case, I put it to the folder named “theme” to make it simple for you. This is the exact link: wordpress\wp-content\themes.

Create a New Page for FAQs

Note: Remember to add this code into the template file to let WordPress identify the manually created layout. For example, you should add “page-faqs.php” to the beginning of the file.

<?php
/**
  * Template Name: FAQs
  */

Step 2: Create a Page

It’s just similar to adding a new page in the Dashboard. Go to Pages > Add New.

Step 3: Choose the Template for The New Page

On the right of the page edit screen, select Page Attributes > Template > FAQs (FAQs is the template name that we created above).

Choose the Template for The New Page

Then, save the draft and click the Preview button to view the template you have created. Yet it’s compulsory to style theme first to make the FAQ page display properly. Here, I already styled theme and don’t include this step to this post. Also, save the page ID for the next step.

Use the Meta Box Plugin to Create Necessary Fields for a FAQs Page

As for an FAQ page like the sample above, I used 2 extensions: Meta Box Group and Meta Box Builder. Using Meta Box Builder is to create Custom Fields by the intuitive UI (for beginners or non-technology users). While Meta Box Group will help you create the Repeated Custom Fields (the repetition of answers and questions).

Step 1: Create Custom Fields by Meta Box Builder

In the Admin panel, go to Meta Box > Custom Fields > Add New. Fill in the necessary information like Title (the name of the folder containing Fields) and ID in the most understandable way for easy management.

Create Custom Fields by Meta Box Builder

Move to the Settings tab and choose Page as a Post Types.

Move to the Settings tab and choose Page as a Post Types

Next, in the Advanced location rules, click Add Rule, select Show, and select the FAQs page you have created.

select Advanced location rules and choose the FAQs page

Click Save Changes, and then move to tab Fields and start creating the necessary ones.

Step 2: Create Group Field

With this template, I will make a field group having one field text and one child field group inside. This is the illustration of the structure of the field that I will create.

Create Group Field

Search and select Group in the dropdown menu once you click Add Field button.

A group will be added to the right side of the screen

Fill in this information:

  • Label: The name which is used to display on the page.
  • ID: the slug of the field
  • Collapsible: Check this if you want to shorten your content and save space.
  • Select Cloneable: allow it to clone this group (You should notice it)
  • Note: Maximum number of clones and Add more text should be heeded. You can see it more clearly in the final FAQs page result.

Step 3: Create Subgroup and Subfields

Similar to the way you create a field group, creating a Subgroup is just simple. Just click the Add Field button inside the group field.

Create Subgroup and Subfields

Here is the field group I created:

the field group I created

 

If adding and configuring custom fields by Meta Box Builder is a bit unfamiliar to you, you can refer to this instustruction.

Click Update to save and go to the FAQs page to see the result.

Click Update to save and go to the FAQs page

In the image, you can see Add More Questions and Add New Tab button. Do you wonder when were they created? As I told you before, in step 2, that you should notice to Cloneable and Add More Text. The Add More Questions and Add New tab were created in this step.

The instructions above are for drag-and-drop Meta Box Builder extension. Besides using the Meta Box Plugin, you can use code with the help of the free Meta Box plugin if you are a coder or developer. Here is an example of the code of the fields above. By inserting it to the functions.php file, you can have a similar result with the Meta Box plugin only. You can refer to this instruction on how to import code from metabox.io.

add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
function your_prefix_register_meta_boxes( $meta_boxes ) {
    $meta_boxes[] = array (
        'title' => 'FAQs Page',
        'id' => 'faqs-page',
        'post_types' => array(
            0 => 'page',
        ),
        'context' => 'normal',
        'priority' => 'high',
        'fields' => array(
            array (
                'id' => 'faq_tab',
                'type' => 'group',
                'name' => 'Tab',
                'fields' => array(
                    array (
                        'id' => 'tab_name',
                        'type' => 'text',
                        'name' => 'Tab Name',
                    ),
                    array (
                        'id' => 'q_and_a',
                        'type' => 'group',
                        'name' => 'Q & A',
                        'fields' => array(
                            array (
                                'id' => 'question',
                                'type' => 'text',
                                'name' => 'Question',
                            ),
                            array (
                                'id' => 'answer',
                                'type' => 'textarea',
                                'name' => 'Answer',
                            ),
                        ),
                        'clone' => 1,
                        'default_state' => 'expanded',
                        'add_button' => 'Add More Questions',
                    ),
                ),
                'clone' => 1,
                'default_state' => 'expanded',
                'add_button' => 'Add New Tab',
            ),
        ),
        'h' => 'a',
        'b' => 'c',
        'include' => array(
            'relation' => 'OR',
            'ID' => 6,
            'template' => array(
                 0 => 'page-faqs.php',
            ),
            'category' => array(
                0 => 1,
            ),
        ),
    );
    return $meta_boxes;
}

Show the Fields’ Content on the FAQs Page

Use this code or take a look at this Meta Box plugin’s documentation.

$group_values = rwmb_meta( 'group_id' );
if ( ! empty( $group_values ) ) {
    foreach ( $group_values as $group_value ) {
        $value = isset( $group_value[$sub_field_key] ) ? $group_value[$sub_field_key] : '';
        echo $value; // Display sub-field value
    }
}

In there:

  • rwmb_meta() to get the value of the fields in the Meta Box plugin.
  • group_id is the created field group’s ID.
  • $sub_field_key the ID of the subfield in the field group

We change group_id intofaq_tab and $sub_field_key into tab_name in this case. (I already set these ID in the first step).

In addition, I made a subgroup in the group, so you can get the value of the subgroup by following this:

$group_values = rwmb_meta( 'group_id' );
if ( ! empty( $group_values ) ) {
    foreach ( $group_values as $group_value ) {
        $value = isset( $group_value[$sub_field_key] ) ? $group_value[$sub_field_key] : '';
        $group_childs = isset( $group_value[$gr_childs] ) ? $group_value[$gr_childs] : '';
            foreach ( $group_childs as $group_child ) {
                $val_child = isset( $group_child[$child_key] ) ? $group_child[$child_key] : '';
                Echo $val_child;
            }
        echo $value;
    }
}
  • $group_childs means the ID of the subgroup
  • $child_key means the field’s ID inside the subgroup.

For instance, this code is for the layout that we have above. (The layout built by Tabs of Bootstrap 4).



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


<main id="Main">
<div class="page-wrapper">
<div class="container">
<div class="row">
<div id="menuBarleft" class="col-lg-3 col-sm-12">
<div id="navbarNav" class="nav nav-tabs">
<div id="v-pills-tab" class="nav flex-column nav-pills menu-left" role="tablist" aria-orientation="vertical">
<?php $group_values = rwmb_meta( 'faq_tab' );
$count = 0;
if ( ! empty( $group_values ) ) {
foreach ( $group_values as $group_value ) {
$count++;
$value = isset( $group_value['tab_name'] ) ? $group_value['tab_name'] : ''; ?>
<a id="v-pills-home-tab" class="<?php if($count ==1) echo 'active'; ?>" role="tab" href="#tab<?php echo $count; ?>" data-toggle="pill" aria-controls="tab<?php echo $count; ?>" aria-selected="true"><?php echo $value; ?> </a>
<?php }
} ?>
</div>
</div>
</div>
<div id="Content" class="col-lg-9 col-sm-12">
<div id="v-pills-tabContent" class="tab-content">
<?php $group_values = rwmb_meta( 'faq_tab' );
$count_c = 0;
if ( ! empty( $group_values ) ) {
foreach ( $group_values as $group_value ) {
$count_c++;
$value = isset( $group_value['tab_name'] ) ? $group_value['tab_name'] : '';
$group_childs = isset( $group_value['q_and_a'] ) ? $group_value['q_and_a'] : ''; ?>
<div id="tab<?php echo $count_c; ?>" class="tab-pane fade <?php if($count_c ==1) echo 'show active'; ?>" role="tabpanel" aria-labelledby="tab<?php echo $count_c; ?>-tab">
<?php
$count_q = 0;
foreach ( $group_childs as $group_child ) {
$count_q++;
$question = isset( $group_child['question'] ) ? $group_child['question'] : '';
$answer = isset( $group_child['answer'] ) ? $group_child['answer'] : ''; ?>
<div class="panel">
<h4 class="panel-title"><a class="" href="#question-trip-<?php echo $count_q; ?>" data-toggle="collapse" aria-expanded="true"><?php echo $question; ?></a></h4>
<div class="panel-content">
<div id="question-trip-<?php echo $count_q; ?>" class="question collapse show">
<?php echo $answer; ?></a>
</div>
</div>
</div>
<?php } ?>
</div>
<?php }
} ?>
</div>
</div>
</div>
</div>
</div>
</main>

Conclusion

With the Meta Box plugin, just by using code or following these easy steps, you can own a FAQs page after a cup of coffee if you are a developer. Even when you are not a tech-savvy person, it’s still somewhat simple and easily understandable if you use Meta Box Builder and Meta Box Group, right?

There are a lot of awesome things that Meta Box can do for you besides creating a FAQs page. You can make use of this plugin by reading more intensive guides here.

Other case studies you might be interested in

  1. Create A Dynamic Landing Page in WordPress Using Custom Field
  2. Create a Filter to Find Hotels by Location
  3. Create an OTA Website Like Booking.com with Meta Box Plugin - P1: Create a Page to Introduce Hotel Rooms
  4. Create an OTA Website Like Booking.com with Meta Box Plugin - P2: Create Filters on the Archive Page
  5. Create an OTA Website Like Booking.com with Meta Box Plugin - P3: Create Filters for Single Hotel Pages
  6. Create Dynamic Favicon in WordPress using Meta Box plugin
  7. Create Posts Series in WordPress Using Meta Box
  8. Display The Latest Products Section - P2 - Using Meta Box and Elementor
  9. Display The Latest Products Section - P3 - Using Meta Box And Oxygen
  10. How to Add Custom Fields for WooCommerce - P2 - Using MB Views
  11. How to Add Custom Fields to Display Banners using Meta Box Plugin
  12. How to Add Guest Authors and Guest Posts - Using Meta Box
  13. How to Add Related Posts - Using Custom Fields
  14. How to Build a Hotel Booking Website Using Meta Box - P1
  15. How to Build a Hotel Booking Website Using Meta Box - P2 - Booking Page in Backend
  16. How to Build a Hotel Booking Website Using Meta Box - P4 - Booking Management Page
  17. How to Build a Hotel Booking Website Using Meta Box – P3 – Booking Page for Customer
  18. How to Create a Classified Ads Website using Meta Box
  19. How to create a FAQs page - P5 - Using Meta Box and Breakdance
  20. How to Create a Product Page - P2 - Using Meta Box and Oxygen
  21. How to Create a Product Page - P3 - Using Meta Box and Bricks
  22. How to Create a Product Page - P4 - Using Meta Box and Elementor
  23. How to Create a Product Page - P5 - Using Meta Box and Gutenberg
  24. How to Create a Product Page - P6 -Using Meta Box and Breakdance
  25. How to Create a Product Page - P7 - Using Meta Box + Kadence
  26. How to Create a Product Page - P8 - Using Meta Box and Brizy
  27. How to Create a Product Page - P9 - Using Meta Box and Divi
  28. How to Create a Product Page using Meta Box Plugin
  29. How to Create a Recipe - P2 - Using Meta Box and Oxygen
  30. How to Create a Recipe - P3 - Using Meta Box and Elementor
  31. How to Create a Recipe - P4 - Using Meta Box and Bricks
  32. How to Create a Recipe - P5 - Using Meta Box and Zion
  33. How to Create a Recipe - P6 - Using Meta Box and Brizy
  34. How to Create a Recipe - P7 - Using Meta Box and Breakdance
  35. How to Create a Recipe - P8 - Using Meta Box and Kadence
  36. How to Create a Recipe - P9 - Using Meta Box and Divi
  37. How to Create a Recipe with Meta Box Plugin
  38. How to Create a Simple Listing - P2 - Using Meta Box and Bricks
  39. How to Create a Simple Listing - P3 - Using Meta Box and Breakdance
  40. How to Create a Simple Listing - P4 - Using Meta Box and Elementor
  41. How to Create a Team Members Page - P1- Using Meta Box and Elementor
  42. How to Create a Team Members Page - P2 - Using Meta Box and Oxygen
  43. How to Create a Team Members Page - P3 - Using Meta Box and Bricks
  44. How to Create a Team Members Page - P4 - Just Meta Box
  45. How to Create a Team Members Page - P6 - using Meta Box and Breakdance
  46. How to Create a Team Members Page - P7 - Using Meta Box and Kadence
  47. How to Create a Video Gallery Page - P2 - Using Meta Box + Bricks
  48. How to Create a Video Gallery Page - P3 - Using Meta Box and Breakdance
  49. How to Create a Video Gallery Page - P4 - Using Meta Box + Elementor
  50. How to Create a Video Gallery Page - P5 - Using MB Views
  51. How to Create a Video Gallery Page - P6 - Using Meta Box and Zion
  52. How to Create a Video Gallery Page Using Meta Box + Oxygen
  53. How to Create ACF Flexible Content Field with Meta Box
  54. How to Create an Auto-Updated Cheat Sheet in WordPress
  55. How to Create an FAQs Page - P1 - Using Meta Box and Elementor
  56. How to create an FAQs page - P2 - Using Meta Box and Oxygen
  57. How to create an FAQs page - P4 - Using Meta Box and Bricks
  58. How to Create an FAQs Page - P6 - Using MB Views
  59. How to Create an FAQs Page - P7 - Using Meta Box and Divi
  60. How to Create an FAQs Page - P8 - Using Meta Box and Kadence
  61. How to Create an FAQs Page -P3- Using Meta Box
  62. How to Create Buttons with Dynamic Link using Custom Fields
  63. How to Create Category Thumbnails & Featured Images Using Custom Fields
  64. How to Create Download and Preview Buttons - P1 - Using Meta Box and Bricks
  65. How to Create Download and Preview Buttons - P2 - Using Meta Box and Oxygen
  66. How to Create Download and Preview Buttons - P3 - Using MB Views
  67. How to Create Download Buttons in WordPress - Using Custom Fields
  68. How to Create Dynamic Landing Page in WordPress - P1 - Using Meta Box and Elementor
  69. How to Create Dynamic Landing Page in WordPress - P2 - Using Meta Box and Bricks
  70. How to Create Menus for Restaurants - P1 - Using Meta Box and Elementor
  71. How to Create Menus for Restaurants - P2- Using Meta Box and Bricks
  72. How to Create Notification Using Custom HTML Field
  73. How to Create Online Admission Form for School or University
  74. How to Create Online Reservation Form for Restaurants using Meta Box
  75. How to Create Relationships - P1 - Using Meta Box and Oxygen
  76. How to Create Relationships - P2 - Using Meta Box and Bricks
  77. How to Create Relationships - P3 - Using MB Views
  78. How to Create Relationships - P4 - Using Meta Box and Breakdance
  79. How to Create Taxonomy Thumbnails & Featured Images - P2 - Using Meta Box and Oxygen
  80. How to Create Taxonomy Thumbnails & Featured Images - P3 - Using Meta Box and Bricks
  81. How to Create Taxonomy Thumbnails & Featured Images - P4 - Using MB Views
  82. How to Create YouTube Video Timestamps on WordPress Website - P1 - Using MB Views
  83. How To Display All Listings On A Map With Meta Box
  84. How to Display Author Bio in WordPress - P1 - Using Meta Box and Bricks
  85. How to Display Images from Cloneable Fields - P1 - with Gutenberg
  86. How to Display Images from Cloneable Fields - P2 - Using Meta Box and Oxygen
  87. How to Display Images from Cloneable Fields - P3 - with Elementor
  88. How to Display Images from Cloneable Fields - P4 - with Bricks
  89. How to Display Opening Hours for Restaurants - P1 - Using Meta Box + Gutenberg
  90. How to Display Opening Hours for Restaurants - P2 - Using Meta Box and Oxygen
  91. How to Display Product Variations - P1 - Using Meta Box and Gutenberg
  92. How to Display Product Variations - P2 - Using Meta Box and Oxygen
  93. How to Display Product Variations - P3 - Using Meta Box and Bricks
  94. How to Display the Dynamic Banners - P2 - Using Meta Box and Bricks
  95. How to Display The Latest Products - P5 - Using Meta Box and Bricks
  96. How to Display the Latest Products - P6 - using Meta Box and Breakdance
  97. How to Display the Latest Products - P7 - Using Meta Box + Kadence
  98. How to Display the Latest Products Section - P4 - Using Meta Box + Zion
  99. How to Display the Most Viewed Posts - P1 - using MB Views

1 thought on “How to Create an FAQs Page -P3- Using Meta Box

Leave a Reply

Your email address will not be published. Required fields are marked *