Determine the last child of the parent menu WP Nav Walker
Is there a way to add a condition to know if the current item of the navigation walker is the last child of the menu or parent?
| Item 1 | Item 2 |
| - Item 1.1 | - Item 2.1 |
| - Item 1.2 | - Item 2.2 |
| - Item 1.3 |----------------- Determine if current item is last child
For example:
if ($item-last_child(of_current_parent) {
...
}
So, how do you determine if the current item is the last child of its siblings?
EDIT: Solved my problem trying this: https://wordpress.stackexchange.com/a/49005/91164 But had to change the logic quite a bit to fit my needs. See my answer below.
Topic walker navigation menus Wordpress
Category Web