• Resolved ral_ani

    (@ral_ani)


    I’m having an issue trying to create a two layer nav, I want it so that if you click on a page you will be able to see its sub pages, only the main parents should appear on all pages

    This is what I have so far, of course this doesn’t seem to work:

    <ul>
                  	<?php
    				if(  $post->post_parent ) {
    				  $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
    				} else {
    				  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    				}
    
    				if ($children){
    					$output = wp_list_pages('title_li=&link_before=<span></span>&child_of='.$post );
                    }else{
    					$output = wp_list_pages('depth=1&link_before=<span></span>&title_li=' );
    				}
                    ?>
                  </ul>

    I copied this from somewhere, but wouldn’t mind using any code that works, as you can see from the above the links need a span tag as well

    Hope someone can help me

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Two layer navigation’ is closed to new replies.