wp_list_pages and position of current_page_item / _parent / _ancestor
|Reported by:||stgoos||Owned by:||anonymous|
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.