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 01 Answer
Reset to default 1The 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');