Opened 16 years ago
Closed 12 years ago
#8959 closed enhancement (wontfix)
wp_list_pages and position of current_page_item / _parent / _ancestor
Reported by: | stgoos | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Template | Keywords: | |
Focuses: | Cc: |
Description
I'm currently using the CSS only menu dropdown solution from http://cssmenus.co.uk/dropdown.html which works great but I can't style the active menu selection properly as the class elements current_page_item / _parent / _ancestor are connected to the <li> tag rather then the <a href> tag. With this you can't highlight the actual menu path because it would affect whole submenus as well...
My suggestion is to include an additional argument to the wp_list_pages function with which you can control the output location of the current_page_item / _parent / _ancestor class elements.
Defaul behaviour: the current_page_ class elements gets assigned to the <li> tag just like it happens now.
Alternative behaviour: the current_page_ class elements gets assigned to the <a href> tag to allow alternative css styling options.
This would affect the following functions / files:
- wp_list_pages function in /wp-includes/post-template.php
- start_el function in /wp-includes/classes.php
And probably also the wp_page_menu function in /wp-includes/post-template.php to keep that one in line with the wp_list_pages function.
Change History (7)
#3
@
16 years ago
- Milestone changed from 2.8 to Future Release
Punting due to feature freeze. Reconsider with next release.
You should be able to do whatever styling you'd like using the class on the li tag.
Looking at the CSS on the cssmenus site, this appears to be what they're doing: