<Slushman />

unsplash-logo Alex Read

How to Set Dashboard to Use One Column

Published Aug 11, 2011

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 the most recent posts:

How to Center in CSS

This is the ultimate guide to centering elements like images, text, and just about anything else using CSS.