• Is there any way I can set (through functions.php) wordpress to display the dashboard widgets set on 1 column instead of the default 2 columnns? thanks

Viewing 1 replies (of 1 total)
  • Rauli

    (@rauli)

    The New Post column layout by default is 2 if the usermeta data for this setting is otherwise (which can only be 1) does not exist in the database.

    The following code added to your themes functions.php should update the currently logged in users meta data (if the field does not already exist) to set the column layout of the New Post screen to 1. In this way all new registrations default to that 1 column layout immediately:-

    <?php
    /*Set the default column layout in the New Post section to one column for new users*/
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;
    $prev_value = NULL;
    update_user_meta($user_id, screen_layout_post, 1, $prev_value);
    ?>

    [Please post code snippets between backticks or use the code button.]

    I put this code right at the bottom (after the last ‘?>’)of my functions.php of my mystique theme.

    Hope this helps, I spent ages looking for this and had to work it out myself.

    Regards,
    Rauli

Viewing 1 replies (of 1 total)
  • The topic ‘Set screen layout number of columns to default 1 column’ is closed to new replies.