|

- UID
- 67
- 帖子
- 71
- 精华
- 0
- 积分
- 236
- 威望
- 153
- 金豆
- 68
- 阅读权限
- 10
- 在线时间
- 96 小时
- 注册时间
- 2008-6-19
|
楼主
发表于 2008-8-30 01:23
| 只看该作者
让Wordpress在导航条隐藏某个已发布的页面
文章作者:Slyar 文章来源:Slyar Home (www.slyar.com) 转载请注明,谢谢合作。
有人问起如何隐藏一个已发布的页面,在查过Wordpress的Codex后得到方法。Exclude Pages from List
Use the exclude parameter hide certain Pages from the list to be generated by wp_list_pages.
<ul>
<?php wp_list_pages('exclude=17,38' ); ?>
</ul>
知道了这个参数,那么解决方法也就有了:
1、在Wordpress后台得到你想要隐藏的页面ID号,比如说10号
2、打开模板文件夹下的header.php
3、查找php wp_list_pages,例如我就得到:
<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
4、在后面的参数表里加入一句&exclude=10(就是你想隐藏的ID号),例如我修改后就是:
<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order&exclude=10'); ?>
5、保存文件,搞定
[ 本帖最后由 slyar 于 2008-8-30 15:29 编辑 ] |
|