Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good afternoon

Show 2nd & 3rd Level Navigation Together

SnippetsWordPress

About a 1 minute read

"This is the real secret of life — to be completely engaged with what you are doing in the here and now. And instead of calling it work, realize it is play."

Alan Watts


1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php global $wp_query;
     $post = $wp_query->post;
     $ancestors = get_post_ancestors($post);
     if( empty($post->post_parent)) {
          $parent = $post->ID;
     } else {
          $parent = end($ancestors);
     }
     if(wp_list_pages("title_li=&child_of=$parent&echo=0")) { ?>
     
     <ul>
          <?php wp_list_pages("title_li=&child_of=$parent&depth=0"); ?>
     </ul>
<?php } ?>