I'm trying to create a second level navigation in WordPress. I've found lots of examples, but none of them seem to do exactly what I want. This code below has me almost there, but I want an active class or better yet a way to only show the sub navigation if I'm on it. It would be great it WordPress had a depth_start option along with depth.
link1 link2 (active class) link2-1 link2-2 link2-3 link3 link4
Code so far:
<?php $parent = array_reverse(get_post_ancestors($post->ID)); $first_parent = get_page($parent); $args = array( 'depth' => 0, 'child_of' => $first_parent->ID, 'title_li' => __($first_parent->post_title), 'sort_column' => 'menu_order', ); ?> <nav class="sidebar"> <ul> <?php wp_list_pages( $args ); ?> </ul> </nav>