Slushman

unsplash-logo Alex Read

How to Set Dashboard to Use One Column

Published 2011-08-11

I’m working on a plugin where I need the Dashboard to have one column for all users. While I could log into every user and change their Screen Options to one column, it would take next to forever with thousands of students accessing this site. Thankfully, I found this bit of code on Stackexchange (thanks sorich87!) and modified it for the Dashboard page. This will force all users to have one column on the Dashboard.

function screen_layout_columns($columns) {
    $columns['dashboard'] = 1;

    return $columns;
}

add_filter('screen_layout_columns', 'screen_layout_columns');

function screen_layout_dashboard() {
    return 1;
}

add_filter('get_user_option_screen_layout_dashboard', 'screen_layout_dashboard');

Gist of the code above

Share this post!

Check out these most recent posts:

How to Add a Class to a Metabox

Toggling the visibility of a metabox using a form requires the metabox to have a custom class. This is how to add custom classes to a metabox.

ArtistDataPress Expiration

In case you haven't heard, ArtistData is shutting down, so the ArtistDataPress plugin will also be shutting down as of October 14.

Avoiding get_theme_mod Errors

If you're getting an error related to the get_theme_mod function, the solution is simpler than you think. Check out this solution.