Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress: Is there a way to adjust the Column Width for the Post table?

Tags:

wordpress

None of the suggested topics about width concern WordPress. What I need is a way to adjust the width of the Posts table which comes up when Posts is selected (Title Author Categories, etc.) I've looked in Appearance/Edit at every .php Template and can't find anything relating to this. I'm sure I've missed something. Also, I have no immediate need for the "Date" and "Tags" columns. Can I either delete these or least hide them?

Thanks, Mike Carter

like image 662
Mike Carter Avatar asked Aug 24 '10 18:08

Mike Carter


3 Answers

You can do this by creating a tiny plugin and activating it:

<?php
/*
Plugin Name: hidey
*/

add_action('admin_head', 'hidey_admin_head');

function hidey_admin_head() {
    echo '<style type="text/css">';
    echo '.column-date { display: none }';
    echo '.column-tags { display: none }';
    echo '.column-author { width:30px !important; overflow:hidden }';
    echo '.column-categories { width:30px !important; overflow:hidden }';
    echo '.column-title a { font-size:30px !important }';
    echo '</style>';
}
?>

Obviously, make your CSS adjustments as needed.

like image 183
pp19dd Avatar answered Oct 17 '22 08:10

pp19dd


If you want to do this for only a custom post type's post table, you can add the following action into your functions.php file (or create a small plugin like in pp19dd's answer):

add_action('admin_head', 'mytheme_admin_head');
function mytheme_admin_head() {
    global $post_type;
    if ( 'my_custom_post_type' == $post_type ) {
        ?><style type="text/css"> .column-date { width: 20%; } </style><?php
    }
}
like image 25
Gavin Avatar answered Oct 17 '22 09:10

Gavin


If you look at the top right corner, you should see a button called "Screen Options". Click off some of the columns, you should have more space to read the Titles of your posts.

like image 33
Lucie Palka Avatar answered Oct 17 '22 08:10

Lucie Palka