0

I have a number of custom fields being displayed in the post list page of Admin Dashboard. My post titles are kind of long, and coupled with so many additional fields is making the table feel crowded.

Is it possible to break this up so it's a single full width row containing the post title and below that another row containing all the other fields.

Forgive to rough mock up, but hopefully this will give you an idea of what I am after.

enter image description here

1 Answer 1

2

You may need to play around with CSS a bit. But for me following CSS does the trick.

Basically

  1. Increase the height of each row.
  2. Shift all cells (td, th) down a bit (using padding-top)
  3. Reset the padding-top for Title column and position it absolutely with appropriate left and right values.

Hope that helps

add_action('admin_head', 'my_custom_style');
function my_custom_style() {
    echo '<style>
    .type-post {
        height: 100px;
    }

    .type-post td, 
    .type-post th, 
    .type-post .fixed .column-comments {
        padding-top: 50px;
    }

    .type-post .column-title.page-title {
        padding-top: 0px;
        left: 35px;
        right: 20px;
        position: absolute;
        /*border: 1px solid red;*/
    }
    </style>';
}

Alternatively you can put the CSS in external file and include it like:

function admin_style() {
  wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css');
}
add_action('admin_enqueue_scripts', 'admin_style');

Note that its 'admin_enqueue_scripts' and not the standard 'wp_enqueue_scripts'

1
  • +10 for you, i try your answer and it looks like what Louis W needs.
    – mmm
    Oct 7, 2017 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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