If you are looking at how to create an FAQs page without using any page builder, we will share an easy and straightforward tip using MB Views that you can follow to build that page. Let’s dive in to explore the process of creating the FAQs page in detail.

This is the page I’d like to create today:

An FAQs page using MB Views

Video Version

Before Getting Started

The FAQs page contains questions and answers that are saved in the custom fields created with Meta Box. The questions and answers will be classified and separated into tabs. In each tab, each pair of questions and answers also will be grouped together.

We need the Meta Box core plugin to have a framework to create custom fields. You can download it directly from wordpress.org.

Besides, we’ll use some Meta Box extensions for more advanced features as follows:

  • MB Views: to create and style the template for the page without touching the theme files;
  • Meta Box Builder: to have a UI on the back end to create custom fields;
  • Meta Box Group: to organize the fields for questions and answers into a group since they are in pairs.

You can install them individually or use Meta Box AIO.

Create a New Page

Go to Pages > Add New to have a new FAQs page.

A new FAQs page

Create Custom Fields

As I mentioned, the questions and answers will be classified in different tabs and also grouped in pairs. So, I’ll create the fields with the following structure.

The questions and answers will be classified in different tabs and also grouped in pairs

The cover group for tabs is cloneable, so you can add as many tabs as you want for multiple kinds of questions.

The cover group for tabs is cloneable

You can also set the title for the group based on the content of the Tab Name field for easier identification.

Set the title for the group based on the content of the Tab Name field

Inside each tab, means the group, I create a field to name the tab. This name will be displayed on the left sidebar of the page.

Also, I added a subgroup that contains two subfields. Thanks to this subgroup, the questions and answers are grouped in a pair. The subgroup also is cloneable so you can add more pairs of questions and answers.

Add a subgroup that contains two subfields

There are 2 text fields inside the subgroup. They are for the questions and answers.

Create 2 text fields inside the subgroup

This subgroup is set to be cloneable as well. It helps to add multiple pairs of questions and answers.

Set the subgroup to be cloneable

After configuring all the fields, move to the Settings tab. Choose Location as Post Type and select Page.

Select Page in the Settings tab

To apply these fields to the page you want, go to the Advanced Location Rules section below and choose the name of the page.

Choose the name of the page

Now, go to the page editor, you will see the custom fields displayed.

The custom fields displayed on the page editor

Display the FAQs on the Page

Get and Display Q&As from Custom Fields

Go to Views in Meta Box and create a new one.

Go to Views in Meta Box and create a new one

To get the data saved in the custom fields, just click on the Insert Field button and choose the name of the created fields from the list.

Choose the name of the created fields from the list to get the data saved in the custom fields

Since the created fields are all the subfields in a group named Tabs. You must click on it to open it up. Whenever you click on it, a loop will be added to the template since the group is cloneable.

A loop will be added to the template when I click to Tabs

We’ll insert fields inside this loop. First, insert the Tab Name field into the loop.

Insert the Tab Name field into the loop

The page I’ll create today has two sections. One on the left are the names of the tabs. And, the one on the right are the questions and answers. It is separated from the left one, so I will add another loop by clicking on the Tabs field.

Add another loop by clicking on the Tabs field

The group containing the questions and answers is also cloneable, so there will be another loop inside.

Add another loop inside group

Now, just insert the Question field and Answer field into the loop.

Insert the Question field and Answer field into the loop

You can see the structure clearer like this.

The structure of the FAQs page

You should add some div tags and classes to use CSS for styling later.

Add some div tags and classes to use CSS for styling later

Now, set the template type as Singular, and choose the page as its location.

Set the template type as Singular and choose the page as its location

Go to the page on the front end, all the tab names, questions, and answers are displayed already.

All the tab names, questions, and answers are displayed already on the frontend

That’s done for getting the questions and answers from custom fields and displaying them on the page.

Style the Page

Back to the template in the Views, go to the CSS tab, and add some code.

Go to the CSS tab and add some code to style the page

Then the look of the page will change.

The look of the page will change

For now, when you click on the name of each tab, nothing happens. All the pairs of questions and answers still display on the page. There is no classification. You should add JS to make the tabs work.

Add JavaScript for Tabs

Also back to the template, go to the JavaScript tab to add code.

Go to the JavaScript tab to add code

jQuery(document).ready(function()
{
    function activeTab(obj)
    {
        jQuery('.tab-category ul li').removeClass('active');
        jQuery(obj).addClass('active');
        var id = jQuery(obj).find('a').attr('href');
        jQuery('.ul-cate').hide();
        jQuery(id).show();
    }
    jQuery('.tab-category li').click(function(){
        activeTab(this);
        return false;
    });
    activeTab(jQuery('.tab-category li:first-child'));
});

These lines of code are to trigger when users click on any tab name. When I add div tags and classes for each element on the page, I set the class for the tab names as 'tab-category'. So, we’ll trigger the action based on that class.

Set the class for the tab names as 'tab-category'

I also set classes for the section displaying questions and answers and use it in this code.

Set classes for the section displaying questions and answers

If you use this code, please change these classes to your own.

Then, we need to add a line of code to the theme’s file to declare the JavaScript library:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>

Add a line of code to the theme’s file to declare the JavaScript library

All of the code I’m using in this practice is uploaded on our Github channel, you can refer to them.

Now, go to the FAQs page on the frontend, you will see the tabs run as we want.

The FAQs page on the frontend

Last Words

There is another way to add questions and answers that is using a custom post type for them. With that way, you also can classify questions using taxonomy, then using MB Views to display them. Both of that way or this one will work. Just choose one that makes sense to you.

If you want to suggest any tutorials, feel free to leave a comment and keep track of our blog. Let’s try and enjoy it!

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 Custom 404 Page in WordPress - P1 - Using Meta Box and Elementor
  20. How to create a FAQs page - P5 - Using Meta Box and Breakdance
  21. How to Create a Product Page - P2 - Using Meta Box and Oxygen
  22. How to Create a Product Page - P3 - Using Meta Box and Bricks
  23. How to Create a Product Page - P4 - Using Meta Box and Elementor
  24. How to Create a Product Page - P5 - Using Meta Box and Gutenberg
  25. How to Create a Product Page - P6 -Using Meta Box and Breakdance
  26. How to Create a Product Page - P7 - Using Meta Box + Kadence
  27. How to Create a Product Page - P8 - Using Meta Box and Brizy
  28. How to Create a Product Page - P9 - Using Meta Box and Divi
  29. How to Create a Product Page using Meta Box Plugin
  30. How to Create a Recipe - P2 - Using Meta Box and Oxygen
  31. How to Create a Recipe - P3 - Using Meta Box and Elementor
  32. How to Create a Recipe - P4 - Using Meta Box and Bricks
  33. How to Create a Recipe - P5 - Using Meta Box and Zion
  34. How to Create a Recipe - P6 - Using Meta Box and Brizy
  35. How to Create a Recipe - P7 - Using Meta Box and Breakdance
  36. How to Create a Recipe - P8 - Using Meta Box and Kadence
  37. How to Create a Recipe - P9 - Using Meta Box and Divi
  38. How to Create a Recipe with Meta Box Plugin
  39. How to Create a Simple Listing - P2 - Using Meta Box and Bricks
  40. How to Create a Simple Listing - P3 - Using Meta Box and Breakdance
  41. How to Create a Simple Listing - P4 - Using Meta Box and Elementor
  42. How to Create a Team Members Page - P1- Using Meta Box and Elementor
  43. How to Create a Team Members Page - P2 - Using Meta Box and Oxygen
  44. How to Create a Team Members Page - P3 - Using Meta Box and Bricks
  45. How to Create a Team Members Page - P4 - Just Meta Box
  46. How to Create a Team Members Page - P6 - using Meta Box and Breakdance
  47. How to Create a Team Members Page - P7 - Using Meta Box and Kadence
  48. How to Create a Video Gallery Page - P2 - Using Meta Box + Bricks
  49. How to Create a Video Gallery Page - P3 - Using Meta Box and Breakdance
  50. How to Create a Video Gallery Page - P4 - Using Meta Box + Elementor
  51. How to Create a Video Gallery Page - P5 - Using MB Views
  52. How to Create a Video Gallery Page - P6 - Using Meta Box and Zion
  53. How to Create a Video Gallery Page Using Meta Box + Oxygen
  54. How to Create ACF Flexible Content Field with Meta Box
  55. How to Create an Auto-Updated Cheat Sheet in WordPress
  56. How to Create an FAQs Page - P1 - Using Meta Box and Elementor
  57. How to create an FAQs page - P2 - Using Meta Box and Oxygen
  58. How to create an FAQs page - P4 - Using Meta Box and Bricks
  59. How to Create an FAQs Page - P6 - Using MB Views
  60. How to Create an FAQs Page - P7 - Using Meta Box and Divi
  61. How to Create an FAQs Page - P8 - Using Meta Box and Kadence
  62. How to Create an FAQs Page - P9 - Using MB Blocks
  63. How to Create an FAQs Page -P3- Using Meta Box
  64. How to Create Buttons with Dynamic Link using Custom Fields
  65. How to Create Category Thumbnails & Featured Images Using Custom Fields
  66. How to Create Download and Preview Buttons - P1 - Using Meta Box and Bricks
  67. How to Create Download and Preview Buttons - P2 - Using Meta Box and Oxygen
  68. How to Create Download and Preview Buttons - P3 - Using MB Views
  69. How to Create Download Buttons in WordPress - Using Custom Fields
  70. How to Create Dynamic Landing Page in WordPress - P1 - Using Meta Box and Elementor
  71. How to Create Dynamic Landing Page in WordPress - P2 - Using Meta Box and Bricks
  72. How to Create Menus for Restaurants - P1 - Using Meta Box and Elementor
  73. How to Create Menus for Restaurants - P2- Using Meta Box and Bricks
  74. How to Create Notification Using Custom HTML Field
  75. How to Create Online Admission Form for School or University
  76. How to Create Online Reservation Form for Restaurants using Meta Box
  77. How to Create Relationships - P1 - Using Meta Box and Oxygen
  78. How to Create Relationships - P2 - Using Meta Box and Bricks
  79. How to Create Relationships - P3 - Using MB Views
  80. How to Create Relationships - P4 - Using Meta Box and Breakdance
  81. How to Create Taxonomy Thumbnails & Featured Images - P2 - Using Meta Box and Oxygen
  82. How to Create Taxonomy Thumbnails & Featured Images - P3 - Using Meta Box and Bricks
  83. How to Create Taxonomy Thumbnails & Featured Images - P4 - Using MB Views
  84. How to Create YouTube Video Timestamps on WordPress Website - P1 - Using MB Views
  85. How to Display a Video Playlist - P1- Using MB Views
  86. How To Display All Listings On A Map With Meta Box
  87. How to Display Author Bio in WordPress - P1 - Using Meta Box and Bricks
  88. How to Display Author Bio in WordPress - P2 - Using MB Views
  89. How to Display Dynamic Banners in WordPress - P3 - Using MB Views
  90. How to Display Images from Cloneable Fields - P1 - with Gutenberg
  91. How to Display Images from Cloneable Fields - P2 - Using Meta Box and Oxygen
  92. How to Display Images from Cloneable Fields - P3 - with Elementor
  93. How to Display Images from Cloneable Fields - P4 - with Bricks
  94. How to Display Opening Hours for Restaurants - P1 - Using Meta Box + Gutenberg
  95. How to Display Opening Hours for Restaurants - P2 - Using Meta Box and Oxygen
  96. How to Display Product Variations - P1 - Using Meta Box and Gutenberg
  97. How to Display Product Variations - P2 - Using Meta Box and Oxygen
  98. How to Display Product Variations - P3 - Using Meta Box and Bricks
  99. How to Display the Dynamic Banners - P2 - Using Meta Box and Bricks

Leave a Reply

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