Many people wants to see the number of attachments which are used for posts. In Post list page people wants to see the number of image and other attachments. Using following code you will be able to see the attachment count in post list section.
image attachments count in Post
You just need to copy and paste the following code into functions.php file.
add_filter('manage_posts_columns', 'posts_columns_attachment_count', 5); add_action('manage_posts_custom_column', 'posts_custom_columns_attachment_count', 5, 2); function posts_columns_attachment_count($defaults){ $defaults['wps_post_attachments'] = __('Attached'); return $defaults; } function posts_custom_columns_attachment_count($column_name, $id){ if($column_name === 'wps_post_attachments'){ $attachments = get_children(array('post_parent'=>$id)); $count = count($attachments); if($count !=0){echo $count;} } }
Ref Url: http://wpsnipp.com/index.php/functions-php/display-post-attachment-count-in-admin-column/