Add menu separators to navigation

plugin banner

Add customisation to allow separator line and text-only entries to the output of the WordPress `wp_nav_menu` function.

Author:Say Hello GmbH (profile at wordpress.org)
WordPress version required:5.0
WordPress version tested:6.1
Plugin version:2.1.3
Added to WordPress repository:04-05-2016
Last updated:11-11-2022
Rating, %:100
Rated by:3
Plugin URI:https://wordpress.org/plugins/mhm-menu-separa...
Total downloads:13 302
Active installs:1 000+
plugin download
Click to start download

Allow separator (HR / line) and unlinked, text-only entries in WordPress’ classic navigation menus.

Block editor

This plugin does not support the Block Editor or the navigation block. It is intended for use with the classic menus (e.g. wp_nav_menu).

Usage

  1. Upload the plugin folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Edit your menu in the “Appearance” section of WordPress Admin. Add a custom link entry, then use --- (three dashes) as link text for a horizontal line or use # as a URL for an unlinked menu entry.

Filters

Version 2.1.0 of the plugin added two filters, with which developers can customise the output.

  • mhm-menu-separator/separator allows customisation of a separator output. Receives the arguments '<hr class="mhm-menu-separator">' (the uncustomised HTML) and $item (the menu item).
  • mhm-menu-separator/title allows customisation of an unlinked menu entry. Receives the arguments $item->post_title (the plain, unlinked menu item text) and $item (the menu item).

ChangeLog