Sticky mobile call bar in WordPress
A bar pinned to the bottom of mobile screens with Call and Directions buttons and a live open-now status, built for trades and local shops.
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
The code in WordPress
<?php
/**
* Plugin Name: Forge, Barre d'appel fixe sur mobile
* Description: Une barre collée en bas de l'écran mobile avec « Appeler » et « Itinéraire », et l'état d'ouverture en direct, pour artisans et commerces locaux. Ajoute la composition « Barre d'appel fixe sur mobile » à 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-bouton-appel-mobile-fixe
*<!-- wp:group {"className": "bap-page", "layout": {"type": "default"}} -->
<div class="wp-block-group bap-page"><!-- wp:group {"tagName": "header", "className": "bap-hero", "layout": {"type": "default"}} -->
<header class="wp-block-group bap-hero"><!-- wp:paragraph {"className": "bap-hero__kicker"} -->
<p class="bap-hero__kicker">Plombier chauffagiste à Villeurbanne</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 1} -->
<h1 class="wp-block-heading">Plomberie Garnier</h1>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "bap-hero__intro"} -->
<p class="bap-hero__intro">Dépannage, chauffe-eau et entretien de chaudières dans l'est lyonnais depuis 2009. Devis gratuit, déplacement offert à Villeurbanne.</p>
<!-- /wp:paragraph --></header>
<!-- /wp:group -->(() => {
if (!document.querySelector(".bap-page")) return;
const DAYS = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"];
function bapTime(minutes) {
const m = minutes % 60;
return `${Math.floor(minutes / 60)} h${m ? ` ${String(m).padStart(2, "0")}` : ""}`;
}
// Works out whether the shop is open now and, if not, when it opens next (up to a week ahead).
function bapStatus(hours, now) {
const day = now.getDay();:root {
--bap-text: #0f172a;
--bap-body: #334155;
--bap-accent: #1d4ed8;
--bap-accent-hover: #1e3a8a;
--bap-line: #dbe3ef;
--bap-surface: #ffffff;
--bap-shadow: 0 -6px 20px rgb(15 23 42 / 0.1);
--bap-call-bg: #1d4ed8;
--bap-call-hover: #1e40af;
--bap-call-text: #ffffff;
--bap-route-bg: #eff6ff;Free component: copy it freely, including for commercial projects.
Other buttons components in WordPress
Buttons components in WordPress
A row of buttons to share the page on Facebook, LinkedIn, WhatsApp or by email, with a copy-link button and no third-party script.
- Tailwind
- React
- CSS
- WordPress

Toggle heart buttons that count favourites, remember them between visits and announce them to screen readers.
- Tailwind
- React
- CSS
- WordPress

A button that adds an event to Google Calendar, Outlook or any calendar through an .ics file, with no third-party service.
- Tailwind
- React
- CSS
- WordPress

A button that copies an IBAN, a reference, an address or a promo code and confirms "Copied", on screen and to screen readers.
- Tailwind
- React
- CSS
- WordPress

A WhatsApp button pinned to the bottom of the screen that opens a welcome bubble with common topics and a pre-filled message, with no third-party widget.
- Tailwind
- React
- CSS
- WordPress

Circular icon buttons with an accessible tooltip on hover and focus.
- Tailwind
- React
- CSS
- WordPress