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>

 

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2021-08-18
  • 2021-12-01
  • 2021-06-06
  • 2021-08-13
  • 2021-11-12
  • 2021-06-20
相关资源
相似解决方案