The site header: logo, menu and phone
There is one header for every page, and it should be edited once, not on each page. The logo and phone live in site settings, the menu items in an ordinary WordPress menu.
What you get
<!-- theme-options.html: what the client edits once -->
<body wp-fields-group="Site settings">
<img src="images/logo.png" alt="Warm Corner" opt-image="Logo">
<a href="tel:+15550100199" opt-link="Phone link">
<span opt-text="Phone">+1 (555) 010-0199</span></a>
</body>
<!-- the header of every page -->
<header class="header">
<a class="header__logo" href="/"><img src="images/logo.png" alt="Warm Corner" opt-image="Logo"></a>
<nav class="header__nav" wp-menu="Header Menu">
<a href="/" class="header__link">Home</a>
<a href="/menu" class="header__link">Menu</a>
<a href="/contacts" class="header__link">Contacts</a>
</nav>
<a class="header__phone" href="tel:+15550100199" opt-link="Phone link">
<span opt-text="Phone">+1 (555) 010-0199</span></a>
</header>- Home
- Menu
- Contacts
- Blog
+1 (555) 010-0199
The client added “Blog” in Appearance → Menus.
Step by step
The site settings page
The
theme-options.htmlfile with a wp-fields-group group is the settings screen in the admin. Everything marked in it withopt-is shared by the whole site.<body wp-fields-group="Site settings">
The logo
opt-image on the
<img>, both in the settings and in the header of every page. The client changes the logo once.<img src="images/logo.png" alt="Warm Corner" opt-image="Logo">
The menu
wp-menu on the block of links. “Load data” creates the “Header Menu” menu from your links; after that the client edits it in Appearance → Menus.
<nav class="header__nav" wp-menu="Header Menu"> <a href="/" class="header__link">Home</a> <a href="/menu" class="header__link">Menu</a> <a href="/contacts" class="header__link">Contacts</a> </nav>
The phone
The
tel:link isopt-link, the number inside it opt-text, with different names. The number changes across the whole header at once.<a class="header__phone" href="tel:+15550100199" opt-link="Phone link"> <span opt-text="Phone">+1 (555) 010-0199</span></a>
What matters
- Menu items take the classes of the first link; the current page gets the
w--currentclass, as in Webflow, so style that. - “Load data” rebuilds the menu from the markup and replaces the client’s edits: run it for menus once, at the start.
Common mistakes
The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.
<nav class="header__nav" wp-menu="Header Menu">
<a href="/" class="header__link is-active">Home</a>
<a href="/menu" class="header__link">Menu</a>
</nav>The active-item class on the first link: every menu item gets it. The log stays silent.
<nav class="header__nav" wp-menu="Header Menu">
<a href="/" class="header__link">Home</a>
<a href="/menu" class="header__link">Menu</a>
</nav>The links are identical in the markup; the active item is styled through w--current.