Two-tier navigation in WordPress
A strip of practical details (phone, opening hours) above the main navigation.
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, Navigation à double niveau
* Description: Un bandeau d'informations pratiques (téléphone, horaires) au-dessus de la navigation principale. Ajoute la composition « Navigation à double niveau » à 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-navbar-double-niveau
*<!-- wp:html -->
<header class="tier-navbar-double-niveau" data-nav>
<div class="tier-navbar-double-niveau__info">
<div class="tier-navbar-double-niveau__inner">
<a class="tier-navbar-double-niveau__phone" href="tel:+33240000000">02 40 00 00 00</a>
<p class="tier-navbar-double-niveau__hours">Du lundi au vendredi, 8 h – 18 h · Samedi, 9 h – 12 h</p>
</div>
</div>
<div class="tier-navbar-double-niveau__inner tier-navbar-double-niveau__main">
<a class="tier-navbar-double-niveau__brand" href="#accueil">Garage <strong>Rivière</strong></a>
<button type="button" class="tier-navbar-double-niveau__toggle" data-nav-toggle aria-expanded="false" aria-controls="tier-panel" aria-label="Menu">
<svg viewBox="0 0 24 24" aria-hidden="true"><path class="icon-open-navbar-double-niveau" d="M4 7h16M4 12h16M4 17h16"/><path class="icon-close-navbar-double-niveau" d="M6 6l12 12M18 6 6 18"/></svg>(() => {
if (!document.querySelector(".tier-navbar-double-niveau")) return;
document.querySelectorAll("[data-nav]").forEach((nav) => {
const toggle = nav.querySelector("[data-nav-toggle]");
const setOpen = (open) => {
nav.toggleAttribute("data-open", open);
toggle.setAttribute("aria-expanded", String(open));
};
toggle.addEventListener("click", () => setOpen(!nav.hasAttribute("data-open")));
nav.addEventListener("keydown", (event) => {
if (event.key === "Escape" && nav.hasAttribute("data-open")) {
setOpen(false);:root {
--tier-navbar-double-niveau-info-bg: #292524;
--tier-navbar-double-niveau-info-text: #e7e5e4;
--tier-navbar-double-niveau-bg: #fffbeb;
--tier-navbar-double-niveau-border: #fde68a;
--tier-navbar-double-niveau-text: #292524;
--tier-navbar-double-niveau-accent: #92400e;
--tier-navbar-double-niveau-cta: #f59e0b;
--tier-navbar-double-niveau-cta-text: #1c1003;
--tier-navbar-double-niveau-ring: #b45309;
--demo-navbar-double-niveau-bg: #fffdf5;
--demo-navbar-double-niveau-text: #44403c;Free component: copy it freely, including for commercial projects.
Other navigation bars components in WordPress
Navigation bars components in WordPress
A navigation that sits at the bottom of the screen, under the thumb, on phones, and becomes a horizontal bar at the top on desktop.
- Tailwind
- React
- CSS
- WordPress

Logo on the left, links in the middle, call to action on the right, collapsible menu on mobile.
- Tailwind
- React
- CSS
- WordPress

The house name in the middle, links split on each side, restaurant or designer-shop style.
- Tailwind
- React
- CSS
- WordPress