Skip to content

Instantly share code, notes, and snippets.

@yaharga
yaharga / class-detailed-navigational-menu-walker.php
Last active October 10, 2021 23:50
This is a custom detailed navigational menu walker I worked on that adds various classes to identify li's, links, and ul's, with the code being collected from various walkers shared by other users.
<?php
/**
* Detailed Navigational Menu Walker
*
* Gives navigational menu detailed classes depending on position.
* Includes numbering positions, first and last classes, depth dependant classes, even and odd classes depending on position and depth, and number of children being even or odd.
*
* @class Detailed Navigational Menu Walker
* @version 1.0.0
* @package Yolk