[GUIDE] Simple FAQ page with Accordion

This is an easy guide for an FAQ page. 

Step 1. Login to your admin dashboard -> settings -> pages

Step 2. Click on “Add page” -> fill the necessary fields; Title: “What ever you want” Page status: “Active page” Type: “Internal” Page visibility: “Visible page” URL key: “faq” File path: “faq.php”

Step 3. Source code: Copy and paste this code. You must change the Questions and answers your self. I have made my own, I recommend you do the same.

<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php G\Render\include_theme_header(); ?>

<div class="content-width">
    <div class="c24 center-box">
        <div class="header default-margin-bottom">
            <h1>Frequently Asked Questions</h1>
        <div class="text-content">

            <button class="accordion">Question 1</button>
            <div class="panel">
              <p>Answer 1.</p>

            <button class="accordion">Question 2</button>
            <div class="panel">
              <p>Answer 2.</p>
            <button class="accordion">Question 3</button>
            <div class="panel">
              <p>Answer 3.</p>

            <button class="accordion">Question 4</button>
            <div class="panel">
              <p>Answer 4.</p>
            <button class="accordion">Question 5</button>
            <div class="panel">
              <p>Answer 5.</p>

            <button class="accordion">Question 6</button>
            <div class="panel">
              <p>Answer 6.</p>

            <button class="accordion">Question 7</button>
            <div class="panel">
              <p>Answer 7.</p>
<div id="powered-by" class="footer">FAQ Page by <a href="https://freeimage.host" rel="generator">FREEIMAGE.host</a> image hosting</div>
var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
  acc[i].onclick = function() {
    var panel = this.nextElementSibling;
    if (panel.style.maxHeight){
      panel.style.maxHeight = null;
    } else {
      panel.style.maxHeight = panel.scrollHeight + "px";

<?php G\Render\include_theme_footer(); ?>

Step 4. Custom CSS via dashboard -> settings -> theme, scroll down to the “Custom CSS” box and insert this code:

/* Style the buttons that are used to open and close the accordion panel */
button.accordion {
    font-family: 'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
    font-size: 1em;
    font-weight: 500;
    background-color: #ffffff; /* WHITE Question buttons, change this if needed */
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: 0.4s;

/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
button.accordion.active, button.accordion:hover {
    background-color: #ccc;

/* Style the accordion panel. Note: hidden by default */
div.panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
button.accordion:after {
    content: '\02795'; /* Unicode character for "plus" sign (+) */
    font-size: 8px;
    color: #777;
    float: right;
    margin-left: 5px;

button.accordion.active:after {
    content: "\2796"; /* Unicode character for "minus" sign (-) */

This should do the trick. You can change the looks of everything with some minor changes on the CSS.

Please follow and like us:

Leave a Reply