0

Can anyone please help me with my problem regarding my WordPress left hand side admin menu. I want it collapsed at all times, how do I do that?

Well, I'm creating a WP Multisite so I want that menu bar to be always collapsed at all times.

Any help would be appreciated. Looking for code or if plugin exists, should be fine, too. Thanks.

1

This will properly override the user settings to keep the menu collapsed for all users:

/**
 * Reset user setting to always collapse the admin menu.
 *
 * @see set_user_setting()
 */
function wpdocs_always_collapse_menu() {
    if ( 'f' != get_user_setting( 'mfold' ) ) {
        set_user_setting( 'mfold', 'f' );
    }
}
add_action( 'admin_head', 'wpdocs_always_collapse_menu' );
0

You can try something like this.

function make_menu_unfolded() {
    print '<script>jQuery(document).ready(function(){jQuery("body").addClass("folded")})</script>';
}
add_filter( 'admin_head', 'make_menu_unfolded' );

This is make left menu fold always.

  • Not sure I'd ever recommend dumping some jQuery into the admin head just to add a class. – DrewAPicture Sep 28 '14 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.