• Resolved mattyscribs

    (@mattyscribs)


    I had trouble displaying 3rd level navigation menus to display as sperate nav components and worked it thusly:

    <?php if(count(get_post_ancestors($post->ID))>1){?>
    <ul id="subsubnav">
    	<?php wp_list_pages("title_li=&child_of=".$post->post_parent."&depth=1" );?>
    
    <?php }?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    Could be used for any level of navigation I guess, just change the count test in the if statement. I am displaying 2nd and 3rd level nav systems on subpages, the full code for both is:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Thought this might be helpful to others 🙂 Seems pretty efficient too.

  • The topic ‘display third level navigation SOLVED’ is closed to new replies.