Centered logo navigation in WordPress
The house name in the middle, links split on each side, restaurant or designer-shop style.
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 à logo centré
* Description: Le nom de la maison au centre, les liens répartis de chaque côté, façon restaurant ou boutique de créateur. Ajoute la composition « Navigation à logo centré » à 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-logo-centre
*<!-- wp:html -->
<header class="split-nav" data-nav>
<div class="split-nav__bar">
<nav class="split-nav__panel" id="split-panel" data-nav-panel aria-label="Navigation principale">
<ul class="split-nav__links">
<li><a href="#carte" aria-current="page">La carte</a></li>
<li><a href="#vins">Les vins</a></li>
<li class="split-nav__spacer" aria-hidden="true"></li>
<li><a href="#histoire">Notre histoire</a></li>
<li><a href="#reserver">Réserver</a></li>
</ul>
</nav>(() => {
if (!document.querySelector(".split-nav")) 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 {
--split-navbar-logo-centre-bg: #f7f3ec;
--split-navbar-logo-centre-line: #d9cfbf;
--split-navbar-logo-centre-text: #2b241b;
--split-navbar-logo-centre-muted: #6b5d4a;
--split-navbar-logo-centre-ring: #2b241b;
--demo-navbar-logo-centre-bg: #f7f3ec;
--demo-navbar-logo-centre-text: #2b241b;
}
@media (prefers-color-scheme: dark) {
:root.forge-follows-system:not([data-theme="light"]) {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

A strip of practical details (phone, opening hours) above the main navigation.
- Tailwind
- React
- CSS
- WordPress