WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom post type, and I'm adding support for thumbnails (featured image)

        register_post_type('cp_companies', array(
            'labels' => array(
                'name' => __('Companies'),
                'singular_name' => __('Company')
            'public' => true,
            'has_archive' => true,
            'supports' => array('thumbnail', 'title', 'editor')

This is not a theme. This is a plug-in. What I want to do is simply limit (120x120) the size of the featured image.

share|improve this question
up vote 2 down vote accepted

From what I understand, you just want to have a thumb created at 120 x 120 when an image is uploaded using the new post type. Then use that image as the featured image on the custom post pages.

Just add a new image size

add_image_size( 'companies_thumb', 120, 120, true);

Then in the post type template for companies you just call the thumb you defined.

<?php the_post_thumbnail('companies_thumb'); ?>
share|improve this answer
Yeah, get that. But this will leave the user free and let him upload any size he wants, right? I'm looking for a way to limit the user. – Omar Abid Nov 3 '11 at 15:36
Yes, he can upload any size.. but when its uploaded, wp will create an thumb version of the original that is 120x120. The image that displays on the custom post will always be 120x120 since that's the one you are calling. – Andy James Nov 3 '11 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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