Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
  • #1140228

    Hello to all,

    Is it possible to display image size and weights in media library screen ?




    Hey ICEMAN,

    This is more of a WordPress function not the theme. You would need to see if any plugins are available that may provide this function.

    Best regards,
    Jordan Shannon


    Ok Jordan I understand.
    Thank you for your answer.


    if you are satisfied with w x h info there is a little snippet for child-theme functions.php:

    function wh_column( $cols ) {
        $cols["dimensions"] = "Dimensions (w, h)";
        return $cols;
    function wh_value( $column_name, $id ) {
        $meta = wp_get_attachment_metadata($id);
               echo $meta['width'].' x '.$meta['height'];
    add_filter( 'manage_media_columns', 'wh_column' );
    add_action( 'manage_media_custom_column', 'wh_value', 10, 2 );

    you can see then in list-view the width and height of the images


    Thank you Guenni007, it’s nice of you. It’s work perfectly !


    or if you like to have file-size aswell and dimensions:

    delete the above snippet and add:

    add_filter( 'manage_media_columns', 'media_columns_filesize' );
    function media_columns_filesize( $posts_columns ) {
    	$posts_columns['filesize'] = "File Size";
    	$posts_columns["dimensions"] = "Dimensions (w, h)";
    	return $posts_columns;
    add_action( 'manage_media_custom_column', 'media_custom_column_filesize', 10, 2 );
    function media_custom_column_filesize( $column_name, $post_id ) {
    	if ( 'filesize' !== $column_name ) {return;}
    	$bytes = filesize( get_attached_file( $post_id ) );
    	echo size_format( $bytes, 2 );
    add_action( 'admin_print_styles-upload.php', 'filesize_column_filesize' );
    function filesize_column_filesize() {
    	echo'<style>#filesize.column-filesize {width: 10%;}</style>';}
    add_action( 'manage_media_custom_column', 'wh_value', 10, 2 );
    function wh_value( $column_name, $post_id ) {	
    	if ( 'dimensions' !== $column_name ) {return;}	
        $meta = wp_get_attachment_metadata($post_id);
               echo $meta['width'].' x '.$meta['height'];}


    Hi Guenni007,

    Thanks for sharing :)

    Best regards,


    Great !
    Thanks for help Guenni007,
    Best regards,


    i just look to make the filesize row sortable – But that’s not the first thing on my todo list right now.


    Thanks again for sharing Guenni007 !

    I’m sure you got an idea in order to have search button in line view in Media Library ? Actually, this button only exist in grid view (look in attachement)

    Thanks for help Guenni007 !


    don’t know whats happening on your site – i got a search field on list-view:


    Hi Guenni007,

    I don’t know why… I will look for…



    Sure, let us know if anything else.

    Best regards,


    Thank you Basilis !

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.