2009-11-20 79 views
1

我在Wordpress主題上工作,我需要在導航上工作,我在創建它時遇到了一些麻煩。Wordpress導航

我正在尋找的導航是這樣的:www.neu.edu/humanities

我有這個迄今爲止得到:

if (is_front_page()) { 
    wp_list_pages('title_li=&exclude=12&depth=1'); 
} 
else { 
    // display the subpages of the current page while 
    // display all of the main pages and all of the 
    // and display the parent pages while on the subpages 
} 

回答

0
<?php 
    if (is_front_page()) { 
     wp_list_pages('title_li=&exclude12&depth=1'); 
    } 
    else { 
     $output = wp_list_pages('echo=0&depth=1&title_li=&exclude=12'); 
     if (is_page()) { 
     $page = $post-ID; 
     if ($post->post_parent) { 
      $page = $post->post_parent; 
     } 
     $children = wp_list_pages('echo=0&child_of='.$page.'&title_li=&exclude=12'); 
     if ($children) { 
      $output = wp_list_pages('echo=0&child_of='.$page.'&title_li=&exclude=12'); 
     } 
     } 
     echo $output; 
    } 
?>