最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Backend menu sidebar collapsed by default every time?

programmeradmin3浏览0评论
This question already has answers here: WordPress Left Hand Side Admin Menu Always Collapsed (3 answers) Closed 7 years ago.

I would like the backend left menu sidebar be collapsed by default. Yes, I can click the "Collapse menu" button every time but is there a way to have WP open up every time with it collapsed by default?

I tried this solution but it didn't work for me: How to Make admin Sidebar Menu always be Collapse by code

I'm also trying to apply this to a multisite website, not sure if that's why the code from the link didn't work.

Any ideas on how to achieve this?

This question already has answers here: WordPress Left Hand Side Admin Menu Always Collapsed (3 answers) Closed 7 years ago.

I would like the backend left menu sidebar be collapsed by default. Yes, I can click the "Collapse menu" button every time but is there a way to have WP open up every time with it collapsed by default?

I tried this solution but it didn't work for me: How to Make admin Sidebar Menu always be Collapse by code

I'm also trying to apply this to a multisite website, not sure if that's why the code from the link didn't work.

Any ideas on how to achieve this?

Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Mar 29, 2017 at 9:09 TrebTreb 811 silver badge9 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1

The following works with a regular site. I have't worked with multisite yet, but I imagine it should be something along the same line:

function change_user_settings() {
    set_user_setting('mfold', 'f'); //Missing "t" typo caused fatal error
}

add_action('admin_init', 'change_user_settings');
发布评论

评论列表(0)

  1. 暂无评论