Wordpress: Is there a way to adjust the Column Width for the Post table?
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
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.
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
}
}
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.
I had a problem with my double glazing blog, where the Titles of the Posts list were only displaying 3 characters wide, so you had to read way down the page to work out the Title. More annoyingly, everything was fine with my Pages list.
The answer wasn't in changing the width of the column- my first guess. The problem was that there were TOO MANY columns enabled.
On ANY Admin page, try going to the top right of the screen, and look for the Screen Options button. Click that, and you are presented with all the options you can choose from to display information. I simply deselected a number of choices I didn't need. Hey, Presto, with less columns, my Title column became wider. Hope this helps.
One trick is worked for me for 17 inch screen.
Scroll at the bottom of WordPress Dashboard, then click on "Collapse Menu" situated at the Left-Bottom Corner
This will reduce the Dashboard Menu Width size and subsequently increases the size for the Post/Page Table width.
isn't it simple?
The default table view provided by edit.php
(e.g. for Posts/Pages/Events) looks really terrible in narrower viewports because the stylesheet includes fixed width table formatting:
You can shrink the menu away, remove columns from the table, or re-define the style as not fixed:
table.wp-list-table.fixed {
table-layout: auto !important;
}
For a permanent solution, save the above rule in a user-defined stylesheet that gets applied to each page (e.g. using a browser extension such as Stylus).
精彩评论