wordpress后台默认菜单选项顺排序调整


我们在开发wordpress主题时常常用需要调整一个wordpress程序默认的后台菜单选项,那我们今天讲的是如何调整排序,比如说我需要把wordpress后台默认的页面功能调下文章的下方来提示我们wordpress主题用户页面用常用选项,如何完成这样的操作呢,可以通过custom_menu_order和menu_order来实现,下面分享一下方法。

将以下代码添加到当前主题的 functions.php 文件:

12345678910111213141516171819202122232425262728// Rearrange the admin menufunction custom_menu_order($menu_ord) {if (!$menu_ord) return true;return array('index.php', // Dashboard'edit.php?post_type=custom_type_one', // Custom type one'edit.php?post_type=custom_type_two', // Custom type two'edit.php?post_type=custom_type_three', // Custom type three'edit.php?post_type=custom_type_four', // Custom type four'edit.php?post_type=custom_type_five', // Custom type five'separator1', // First separator'edit.php?post_type=page', // Pages'edit.php', // Posts'upload.php', // Media'link-manager.php', // Links'edit-comments.php', // Comments'separator2', // Second separator'themes.php', // Appearance'plugins.php', // Plugins'users.php', // Users'tools.php', // Tools'options-general.php', // Settings'separator-last', // Last separator);} add_filter('custom_menu_order', 'custom_menu_order'); // Activate custom_menu_orderadd_filter('menu_order', 'custom_menu_order');

以上是默认的wordpress后台菜单选项排序,我们可以通过位置的调整来改变顺序。


上一篇:wordpress通过指定ID调用连续的文章内容

下一篇:WordPress分类列表页文章置顶怎样设置


Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器