Timeline for Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
Current License: CC BY-SA 2.5
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 25, 2014 at 15:51 | comment | added | Casper |
I tried to make the code work for my theme, but can't get it work. There will no class applied to my parent item in the menu, when I am on the custom post type portfolio . I have used above code. What can be the problem?
|
|
Nov 29, 2013 at 17:42 | comment | added | honk31 |
this was not working for me, since $item->attr_title pulled out the TITLE, and i wrote the title in capital letters. so i changed the attribute to $item->post_name and now it works fine for me.
|
|
Oct 10, 2011 at 14:58 | comment | added | Philipp Kyeck |
i had to remove the current_page_parent from the navigation item that was my blog - but otherwise it worked. thx
|
|
S Mar 3, 2011 at 17:38 | history | suggested | user2814 | CC BY-SA 2.5 |
If the 10, 2 is left out of the add_filter call, it triggers PHP warnings due to the missing parameters.
|
Mar 3, 2011 at 17:20 | review | Suggested edits | |||
S Mar 3, 2011 at 17:38 | |||||
Oct 19, 2010 at 12:01 | vote | accept | Gavin | ||
Oct 19, 2010 at 11:59 | comment | added | Gavin | That's the stuff! I'm using page templates only because the layouts are rather complex for those pages and don't just list the pages off, however I can still utilize that filter you provided to check the page ID. The nature of this theme is that the theme options get you to match up pages ('home' is this page, 'about' is this page, etc.), so that should work perfectly. Thank you for the (incredibly detailed) assistance! | |
Oct 19, 2010 at 7:29 | history | edited | somatic | CC BY-SA 2.5 |
switched filter hook to "nav_menu_css_class"; added 3 characters in body
|
Oct 19, 2010 at 7:17 | history | edited | somatic | CC BY-SA 2.5 |
deleted 95 characters in body
|
Oct 19, 2010 at 5:36 | history | edited | somatic | CC BY-SA 2.5 |
added 165 characters in body
|
Oct 19, 2010 at 5:25 | history | answered | somatic | CC BY-SA 2.5 |