Registered Menu Locations
The theme defines two menu locations infunctions.php:38-43:
functions.php
Primary Menu (menu-1)
Location: Header navigation barPurpose: Main site navigation (Home, Services, Catalog, Events, Contact, etc.)
Legal Footer Menu (menu-legal)
Location: Footer information sectionPurpose: Legal links (Privacy Policy, Legal Notice, Cookie Policy)
Assigning Menus
Create a menu
Go to Appearance > Menus in WordPress admin.Click Create a new menu and give it a name (e.g., “Main Menu”).
Add menu items
Select pages, posts, custom links, or categories from the left panel.Click Add to Menu to include them.
Assign to location
Under Menu Settings, check the box for:
- Primary for header navigation
- Menú Legal Footer for footer links
Primary Menu Implementation
The primary menu is displayed inheader.php:45-56:
header.php
Menu Parameters
theme_location- Uses the registeredmenu-1locationmenu_id- Addsid="primary-menu"to the<ul>elementcontainer- Set tofalseto remove wrapper divmenu_class- Addsclass="menu"to the<ul>element
Mobile Menu Toggle
The header includes a hamburger button for mobile navigation (header.php:41-43):
js/navigation.js, enqueued at functions.php:125.
Footer Menu Implementation
The legal footer menu is displayed infooter.php:87-109:
footer.php
Menu Parameters
theme_location- Uses the registeredmenu-legallocationmenu_class- Addsclass="footer-links"for stylingcontainer- Set tofalseto remove wrapper divdepth- Set to1to show only top-level items (no submenus)
Fallback Behavior
If no menu is assigned tomenu-legal, the theme displays default legal links:
- Legal Notice (
/aviso-legal) - Privacy Policy (
/politica-privacidad) - Cookie Policy (
/politica-cookies)
The fallback links automatically adjust URLs based on the current language (
$url_prefix) when using Polylang.Multilingual Menu Support
Polylang Integration
When Polylang is active, you should create separate menus for each language:Footer Menu Translation
The footer menu (menu-legal) also supports multiple languages:
footer.php
Menu Styling
Menu styles are defined instyle.css. Key classes:
Primary Menu
Footer Menu
Adding Submenus
WordPress menus support hierarchical structures:Drag and drop items
In Appearance > Menus, drag a menu item slightly to the right under another item.
Custom Menu Classes
Add custom CSS classes to individual menu items:Enable CSS classes
In Appearance > Menus, click Screen Options (top right).Check the CSS Classes box.
Menu Walkers
For advanced menu customization, use a custom walker class:The theme does not currently use a custom walker, but this is available for future enhancements.
Programmatically Adding Menu Items
To add items programmatically:Checking if Menu Exists
Usehas_nav_menu() to check if a menu is assigned:
Menu Item Attributes
Available attributes forwp_nav_menu():
| Parameter | Description | Default |
|---|---|---|
theme_location | Registered menu location | None |
menu | Menu ID, slug, or name | None |
menu_class | CSS class for <ul> | menu |
menu_id | ID attribute for <ul> | Menu slug |
container | Wrapper element (div, nav, false) | div |
container_class | Class for container | None |
container_id | ID for container | None |
depth | How many levels to show | 0 (all) |
fallback_cb | Fallback function if menu missing | wp_page_menu |
before | HTML before link text | Empty |
after | HTML after link text | Empty |
link_before | HTML before link anchor | Empty |
link_after | HTML after link anchor | Empty |
items_wrap | Custom <ul> wrapper | Standard |
walker | Custom walker class | None |
Best Practices
Troubleshooting
Menu not appearing
Menu not appearing
Submenu not displaying
Submenu not displaying
Mobile menu not working
Mobile menu not working