Skip to content

Weekly class schedule in WordPress

A studio or school's weekly timetable, filterable by discipline and level, with remaining places and a day-by-day view on mobile.

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

pattern.html
<!-- wp:html -->
<section class="pch" aria-labelledby="pch-title" data-pch>
        <header class="pch__head">
          <p class="pch__eyebrow">Studio Pas de Côté · saison 2026-2027</p>
          <h2 class="pch__title" id="pch-title">Planning des cours</h2>
          <p class="pch__lede">Semaine type, de septembre à juin. Les places restantes concernent la semaine en cours.</p>
        </header>
        <div class="pch__controls" data-pch-controls hidden>
          <div class="pch__group">
            <span class="pch__glabel" id="pch-f-disc">Discipline</span>
            <div class="pch__chips" role="group" aria-labelledby="pch-f-disc" data-pch-filter="discipline">
              <button type="button" class="pch__chip" data-value="all" aria-pressed="true">Toutes</button>
planning-cours-hebdomadaire.php
<?php
/**
 * Plugin Name: Forge, Planning de cours hebdomadaire
 * Description: Le planning de la semaine d'un studio ou d'une école, filtrable par discipline et par niveau, avec les places restantes et une vue jour par jour sur mobile. Ajoute la composition « Planning de cours hebdomadaire » à 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-planning-cours-hebdomadaire
 *
script.js
(() => {
  if (!document.querySelector(".pch")) return;
  document.querySelectorAll("[data-pch]").forEach((root) => {
    const courses = [...root.querySelectorAll("[data-pch-course]")];
    const days = [...root.querySelectorAll("[data-pch-day]")];
    const tabs = [...root.querySelectorAll("[data-pch-tab]")];
    const tablist = root.querySelector("[data-pch-tabs]");
    const status = root.querySelector("[data-pch-status]");
    const hideFull = root.querySelector("[data-pch-full]");
    const filters = { discipline: "all", level: "all" };
    const mobile = window.matchMedia("(max-width: 47.99rem)");
    const today = new Date().getDay();
style.css
:root {
  --pch-text: #1d1530;
  --pch-muted: #5b5170;
  --pch-card: #ffffff;
  --pch-col: #f3f0fa;
  --pch-line: #ddd6ee;
  --pch-accent: #5b21b6;
  --pch-accent-text: #ffffff;
  --pch-ring: #5b21b6;
  --pch-full: #b42318;
  --pch-ok: #166534;
  --pch-classique: #be185d;

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

Data tables components in WordPress
  • A documentation table showing where a kit or component has been tested (static HTML, WordPress, Elementor, Webflow, v0…), with status, last test date and a remark, filterable by status.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A table of the towns and postcodes a tradesperson covers, with response time and travel fee, filtered by search and by zone.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A timetable table sorted by column and filtered with level and free-place chips, whose rows each become a card on phones.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A filterable table whose visible rows export in one click to a CSV file that opens cleanly in Excel or LibreOffice.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A price table by service: one package to pick, options to tick, and the total with the estimated time recalculated on every click.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A product spec sheet as two-column tables in native collapsible sections, with a button to open or close them all.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component