生活百味交流 :探索生活中的点滴乐趣。

 找回密码
 立即注册
查看: 4|回复: 0

wordpress重新排列后台管理菜单

[复制链接]

主题

帖子

5

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5
发表于 2024-10-5 00:35:18 | 显示全部楼层 |阅读模式
wordpress默认情况下后台的菜单列表如下图所示:
   
   
    但是我们在使用wordpress后台管理网站的时候,有些菜单选项并不是经常会用到的,比如多媒体菜单,儿相对于页面菜单我们又经常用到,那么如何重新排列wordpress的后台菜单管理项呢?方法如下:
   
    在你主题的的functions.php文件中添加如下代码:
   
    /**
   
    * 重新排列wordpress后台菜单管理项,此函数放置于你主题的functions.php文件中
    */
   
    function gs_custom_menu_order($menu_ord) {
    if (!$menu_ord) return true;
    return array(
    'index.php',
    'separator1',
    'edit.php?post_type=page',
    'edit.php',
    );
   
    /* -- 默认参数列表 -- */
   
    /*
    return array(
    'index.php',
    'separator1',
    'edit.php?post_type=page',
    'edit.php',
    'edit.php?post_type=[your_post_type_slug]',
    'upload.php',
    'link-manager.php',
    'edit-comments.php',
    'separator2',
    'themes.php',
    'plugins.php',
    'users.php',
    'tools.php',
    'options-general.php'
    );
    */
    }
    add_filter('custom_menu_order', 'gs_custom_menu_order');
    add_filter('menu_order', 'gs_custom_menu_order');
   
   
    重新排列后的后台管理菜单如下图:
   
   
    参数说明:
   
    index.php:仪表盘,
   
    separator1:第一菜单栏分割线,
   
    edit.php?post_type=page:页面,
   
    edit.php:文章,
   
    edit.php?post_type=[your_post_type_slug]:制定类型的文章编辑菜单(如:page等),
   
    upload.php:多媒体,
   
    link-manager.php:链接,
   
    edit-comments.php:评论,
   
    separator2:第二菜单栏分割线,
   
    themes.php:主题,
   
    plugins.php:插件,
   
    users.php:用户,
   
    tools.php:工具,
   
    options-general.php:设置
   
    以上参数对应的是wordpress后台的默认管理菜单列表,你可以根据自己的喜好来设置他们的排列顺序。
   
    请注明:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|生活百味交流

GMT+8, 2024-10-16 00:23 , Processed in 0.031368 second(s), 19 queries .

Powered by Discuz! X3.4

快速回复 返回顶部 返回列表