Skip to content

Blog post card in WordPress

Visual, category, title, excerpt, author, date and reading time.

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

carte-article-blog.php
<?php
/**
 * Plugin Name: Forge, Carte d'article de blog
 * Description: Visuel, catégorie, titre, extrait, auteur, date et temps de lecture. Ajoute la composition « Carte d'article de blog » à 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-carte-article-blog
 *
pattern.html
<!-- wp:html -->
<ul class="demo-carte-article-blog__grid">
      <li class="post-carte-article-blog">
        <div class="post-carte-article-blog__visual" style="background: linear-gradient(135deg,#a3b18a,#588157)" aria-hidden="true"></div>
        <div class="post-carte-article-blog__body">
          <p class="post-carte-article-blog__category">Guide</p>
          <h2><a href="#article">Choisir son carrelage de salle de bains</a></h2>
          <p class="post-carte-article-blog__excerpt">Grès cérame, terre cuite ou pierre naturelle : nos conseils pour concilier style, entretien et budget.</p>
          <p class="post-carte-article-blog__meta">Julie Martin · <time datetime="2026-10-03">3 octobre 2026</time> · 6 min de lecture</p>
        </div>
      </li>
      <li class="post-carte-article-blog">
style.css
:root {
  --post-bg: #ffffff;
  --post-line: #e3e8dd;
  --post-text: #1b2a1a;
  --post-muted: #4d5c4a;
  --post-accent: #3a5a40;
  --post-ring: #3a5a40;
  --demo-carte-article-blog-bg: #f6f8f3;
  --demo-carte-article-blog-text: #1b2a1a;
}

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

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

Cards components in WordPress
  • A single-plan pricing card: struck-through price and discount, a places-left gauge driven by a data attribute, the list of everything included and a booking button that turns into a waiting list once sold out.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three treatment cards in accessible neumorphism: gently raised surfaces, buttons that sink in when activated, a light/dark switch for the block itself. 3:1 outlines and AA text kept.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Four fully clickable workshop cards in a neo-brutalist style: thick border, solid offset shadow and a card that sinks onto its shadow on hover or focus. Pastel tones, dark mode, no JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three brutalist service cards: one-pixel border, hard offset shadow that lifts on hover and sinks on click, large type, accent and dark variants. No JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A mobile page to link from your social profiles: portrait, name, priority links (booking, WhatsApp, website, reviews, call), opening hours with an open or closed status, social links and a share button, in dependency-free HTML and CSS.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A seasonal promotion card with a struck-through price and discount that announces by itself whether the offer is coming, how many days are left or that it is over.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component