Support » Plugin: Admin Columns » [Plugin: Codepress Admin Columns] Feature Suggestion – Images based on Media ID

  • Resolved robgundling


    Great plugin – Just discovered it and also got your Sort Order addon – saved me a bunch of programming time.

    I have an image in a “Front Page Slides” custom post type that returns a media ID for an image and not a URL where I want to show a scaled down pic in the back end.

    Would be great to show the image using the built in wp_get_attachment_image( $id, $size ) function with an optional size specification.

    Right now, I’m cheating and using the thumbnail view using “media library icon” as the way to view.

    Anyway.. thanks again for a great plugin…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tobias Schutter


    Your image ID is stored in a custom field. So you are doing it correctly by using the “media library icon” from the custom field box.

    You can also set your own image size. Only not within the UI, you will have to add this to your themes functions.php in order to set your own size preference:

    function my_custom_thumbsize()
         // width, height
         return array(30,30);


    function my_custom_thumbsize()
         // or any other preset image size you have set, like thumbnail, medium, large etc.
         return 'medium';

    I see you added a custom hook in there in the Plugin update… awesome!

    Thanks for the response! Implementing now…

    I have been able to implement the hook. The only issue I have is that it is only giving me “square” thumbnails to display. Any hints on how I could do something like 194×63 px?

    Plugin Author Tobias Schutter


    The problem is that the new imagesize (194×63) is not available. WordPress then looks for the closest available size which is the actual thumbnail.

    To show the correct size you will have to add the image size, like so:

    add_image_size('my-thumbnail-size', 194, 63);

    For the full code use this:

    // edit here: fill in your thumbnail height and width
    $my_height = 63;
    $my_width  = 194;
    // stop editing
    add_image_size( 'admin-columns-thumb', $my_width, $my_height, true );
    add_filter('cpac_thumbnail_size', function() {
    	return 'admin-columns-thumb';

    I will add this to make FAQ aswell.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Codepress Admin Columns] Feature Suggestion – Images based on Media ID’ is closed to new replies.