Skip to content

Compact bordered FAQ in WordPress

A tight accordion within a single frame, for practical information pages.

Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in WordPress

faq-compacte-bordee.php
<?php
/**
 * Plugin Name: Forge, FAQ compacte bordée
 * Description: Un accordéon serré dans un cadre unique, pour les pages d'information pratiques. Ajoute la composition « FAQ compacte bordée » à l'éditeur de blocs.
 * Version: 1.0.0
 * Requires at least: 6.6
 * Requires PHP: 8.1
 * Author: Forge
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: forge-faq-compacte-bordee
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "bfaq", "layout": {"type": "default"}} -->
<section class="wp-block-group bfaq"><!-- wp:heading {"level": 2} -->
<h2 class="wp-block-heading">Informations pratiques</h2>
<!-- /wp:heading -->
<!-- wp:group {"className": "bfaq__frame", "layout": {"type": "default"}} -->
<div class="wp-block-group bfaq__frame"><!-- wp:details -->
<details class="wp-block-details"><summary>Le cabinet est-il accessible en fauteuil roulant ?</summary><!-- wp:paragraph -->
<p>Oui, le cabinet est de plain-pied avec une place de stationnement réservée devant l'entrée.</p>
<!-- /wp:paragraph --></details>
<!-- /wp:details -->
<!-- wp:details -->
<details class="wp-block-details"><summary>Faut-il une ordonnance ?</summary><!-- wp:paragraph -->
style.css
:root {
  --bfaq-bg: #ffffff;
  --bfaq-open: #f0fbfa;
  --bfaq-line: #c9e6e3;
  --bfaq-text: #0f2f2c;
  --bfaq-muted: #3f5f5b;
  --bfaq-ring: #0f766e;
  --demo-faq-compacte-bordee-bg: #f4fbfa;
  --demo-faq-compacte-bordee-text: #0f2f2c;
}

@media (prefers-color-scheme: dark) {

Free component: copy it freely, including for commercial projects.

FAQ and accordions components in WordPress
  • A native accordion FAQ where each answer asks “Was this answer helpful?”, with a thank-you message and a remembered vote.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An introduction and a contact link on the left, expandable questions on the right.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Questions grouped under subheadings, for long FAQs.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • All answers visible at once, presented as a card grid.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Frequently asked questions followed by a card inviting visitors to call or write.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Questions that expand one by one, with FAQPage structured data for Google.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component