Styling active links submenu
-
Hello,
I’m trying to modify the standard theme a bit. I want one of my links to display a custom made sub menu. Here is the code that generates the sub-menu:
<?php //submenu global $wp_query; if( empty($wp_query->post->post_parent) ) { $parent = $wp_query->post->ID; } else { $parent = $wp_query->post->post_parent; } ?> <?php if(wp_list_pages("title_li=&child_of=$parent&echo=0" )): ?> <div id="submenu"> <ul> <?php wp_list_pages("title_li=&child_of=$parent" ); ?> </ul> </div> <?php endif; ?>
It works, but is this the best way to make a sub-menu? And how do I keep the main links active when a sub menu item is clicked?
And my final question: How to keep the right sub menu item active as well?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Styling active links submenu’ is closed to new replies.