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
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' );
There is a related Trac ticket: #26354
-
-
@jgauffin You could put that in your currently active theme's
functions.php
file. Mar 31, 2014 at 16:24
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
});
-
4You may also want to add in this to hide the empty box:
.meta-box-sortables.ui-sortable.empty-container { display: none; }
– IpstenuDec 12, 2013 at 20:56 -
this might be nice for all page, but what about a single widget ? May 7, 2019 at 2:25