25

With the new Wordpress 3.8 under Screen Options they seem to have misplaced the "Columns" feature where you could put your widgets into 1 Column, 2 Columns, 3 Columns, or 4 Columns. My question is how to I force my Dashboard Widgets to only be 1 column, or in other words, take up the whole width of the screen versus just a portion of the screen?

2 Answers 2

31

Another solution is to add the columns setting back to the settings.

function wpse126301_dashboard_columns() {
    add_screen_option(
        'layout_columns',
        array(
            'max'     => 2,
            'default' => 1
        )
    );
}
add_action( 'admin_head-index.php', 'wpse126301_dashboard_columns' );

Screenshot of the Screen Layout setting

There is a related Trac ticket: #26354

2
  • where should that code be entered?
    – jgauffin
    Jan 8, 2014 at 12:39
  • @jgauffin You could put that in your currently active theme's functions.php file. Mar 31, 2014 at 16:24
8

This happens because of the new media queries. A very unfortunate change …

Anyway, you can change it by setting a custom width for .postbox-container.

Use 50% for two columns and 100 % for just one column.

add_action( 'admin_head-index.php', function()
{
    ?>
<style>
.postbox-container {
    min-width: 100% !important;
}
.meta-box-sortables.ui-sortable.empty-container { 
    display: none;
}
</style>
    <?php
});
2
  • 4
    You may also want to add in this to hide the empty box: .meta-box-sortables.ui-sortable.empty-container { display: none; }
    – Ipstenu
    Dec 12, 2013 at 20:56
  • this might be nice for all page, but what about a single widget ? May 7, 2019 at 2:25

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