在wordpress导航条中隐藏某个已经发布的页面可以通过编辑wp_list_pages这个函数实现。
WordPress的Codex中有这样的解释:文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
Exclude Pages from List
Use the exclude parameter hide certain Pages from the list to be generated by wp_list_pages.文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
<ul>
<?php wp_list_pages('exclude=17,38' ); ?>
</ul>文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
例如我们要在后台隐藏ID(可以在数据库中查看ID号码)号码是283的页面文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
1、打开head.php文件找到wp_list_pages文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
2、例如我原来的wp_list_pages是这样的:文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
3、我只需要在wp_list_pages函数后面加上&exclude=283,修改后的代码为:文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order&exclude=10'); ?>文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
4、保存,上传到主机空间覆盖原来的head.php文件。文章源自堕落的鱼-https://www.duoluodeyu.com/308.html
1F
不太懂,说得不够清楚