Timeline for Give custom class names to WP nav sub-menu
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 16 at 22:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jul 18 at 0:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Apr 25, 2023 at 17:10 | answer | added | Kyle Klaiber | timeline score: 0 | |
Apr 25, 2023 at 17:08 | comment | added | Kyle Klaiber | @Mari I was actually able to use Artemiy Egorov's answer on that post. Thanks! | |
Apr 25, 2023 at 16:28 | comment | added | Tom J Nowell♦ |
the first answer in the question Mari linked to contains the $depth of the menu items which is exactly what you're asking about, anybody with basic beginner level PHP skills can use an if statement to check its value and return a different class. The answer by vralle even uses the depth to add a class with the depth value and does it in a filter that can be added to any menu. Note that any answer you got here would not be a copy paste solution
|
|
Apr 25, 2023 at 15:53 | comment | added | Kyle Klaiber | @Mari Hi, yes, this allows me to add a class to all instances of sub-menu but not to add different class names to nested sub-menu. | |
Apr 25, 2023 at 15:47 | comment | converted from answer | Mari | have you tried any of these solutions? https://stackoverflow.com/questions/5034826/wp-nav-menu-change-sub-menu-class-name | |
S Apr 25, 2023 at 15:29 | review | First questions | |||
May 9, 2023 at 15:31 | |||||
S Apr 25, 2023 at 15:29 | history | asked | Kyle Klaiber | CC BY-SA 4.0 |