Skip to content

Service card with icon in WordPress

Icon, title, short description, indicative price and link to the details.

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-service-icone.php
<?php
/**
 * Plugin Name: Forge, Carte de service avec icône
 * Description: Icône, intitulé, description courte, prix indicatif et lien vers le détail. Ajoute la composition « Carte de service avec icône » à 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-service-icone
 *
pattern.html
<!-- wp:html -->
<ul class="demo-carte-service-icone__grid">
      <li class="service">
        <span class="service__icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M4 14h16l-2-6H6Zm2 0v4m12-4v4M8 18h8"/></svg></span>
        <h2>Vidange et entretien</h2>
        <p>Forfait révision constructeur, sans perdre votre garantie.</p>
        <div class="service__footer">
          <span class="service__price">dès 89 €</span>
          <a href="#prestation">Détails<span class="service__hidden"> : vidange et entretien</span></a>
        </div>
      </li>
      <li class="service">
style.css
:root {
  --svc-bg: #ffffff;
  --svc-line: #f2e6b8;
  --svc-text: #29230e;
  --svc-muted: #5c5233;
  --svc-icon-bg: #fde68a;
  --svc-icon: #713f12;
  --svc-ring: #a16207;
  --demo-carte-service-icone-bg: #fffcf0;
  --demo-carte-service-icone-text: #29230e;
}

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