WordPress主题开发:输出指定页面导航

实例:

 <ul>
    <li class="widget widget_nav_menu">
<?php 
if(is_page(array(12,14,17,30,24))){
    ?>
<h3>关于我们</h3>
<?php $args = array(
                'depth'       => -1,
                'sort_column' => 'ID',
                'menu_class'  => 'menu',
                'exclude_tree'     => '38',
                'echo'        => true,
                'show_home'   => false,
                'title_li'     => '', 
                'link_before' => '',
                'link_after'  => '' );
            ?>
<ul>
  <?php wp_list_pages($args); ?> 
  </ul>

<?
}
?>
</li>
</ul>

 

posted @ 2017-06-12 23:07  tinyphp  Views(763)  Comments(0Edit  收藏  举报