• Hi all, thanks in advance for the help.

    1. I am trying to make it so that when you click the parent link in the menu, it takes you to that page and then shows the children under that parent page ONLY. For example…

    A person comes to the homepage and sees a menu with the link (Say “About Us”) and clicks on that link. It takes them to the (“About Us”) page, and now shows several links below the (“About Us”) link (for example “About the Author”,”About the Website”, etc.). Then they can click those child links to go to those pages, still keeping visible the parent and children.

    My problem is, when I implement this code:

    <?php
    				$output = wp_list_pages('echo=0&depth=1&title_li=' );
    				if (is_page( )) {
      					$page = get_query_var('page_id');
      					if ($post->post_parent) {
        					$page = $post->post_parent;
      					}
      					$children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' );
      					if ($children) {
        					$output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=');
      					}
    				}
    				echo $output;
    			?>

    All the children show up (regardless of its parent). So, for example, if I have multiple parents (say “About Us”,”Books”,etc.), all the children for each of those show up with my code, regardless of what the user has clicked on.

    I would like the user to only see the children from the parent they clicked on.

    2. What CSS markups can I use to style the children different from the parents in my example?

  • The topic ‘Nav Menu Children Help Please!’ is closed to new replies.