Skip to content

Open card FAQ in WordPress

All answers visible at once, presented as a card grid.

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-cartes-ouvertes.php
<?php
/**
 * Plugin Name: Forge, FAQ en cartes ouvertes
 * Description: Toutes les réponses visibles d'emblée, présentées en grille de cartes. Ajoute la composition « FAQ en cartes ouvertes » à 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-cartes-ouvertes
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "open-faq", "layout": {"type": "default"}} -->
<section class="wp-block-group open-faq"><!-- wp:heading {"level": 2} -->
<h2 class="wp-block-heading">Bon à savoir</h2>
<!-- /wp:heading -->
<!-- wp:html -->
<dl>
          <div>
            <dt>Combien de temps dure une séance ?</dt>
            <dd>Une heure, échauffement et étirements compris. Le bilan initial dure une heure trente.</dd>
          </div>
          <div>
            <dt>Faut-il du matériel ?</dt>
style.css
:root {
  --open-bg: #ffffff;
  --open-text: #3b1406;
  --open-muted: #7a3b1f;
  --open-mark: #f97316;
  --demo-faq-cartes-ouvertes-bg: #fff4ec;
  --demo-faq-cartes-ouvertes-text: #3b1406;
}

@media (prefers-color-scheme: dark) {
  :root.forge-follows-system:not([data-theme="light"]) {
    --open-bg: #24120a;

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
  • A tight accordion within a single frame, for practical information pages.

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

    • 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