Skip to main content
added 50 characters in body
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

In order to use that function you need to declare this in your theme.

add_theme_support( 'post-thumbnails' );

I tested your code and it works fine, the only way I can duplicate your error is to remove the above.

It might also be because you seem to be using a CPT called "photos", have you made sure it supports the right parameters, specifically supports 'thumbnail'?,

// rest of your CPT params
'supports' => array('thumbnail'),

http://codex.wordpress.org/Function_Reference/register_post_type

You can test this quickly by trying,

add_post_type_support( 'photos', 'thumbnail' ) 

In order to use that function you need to declare this in your theme.

add_theme_support( 'post-thumbnails' );

I tested your code and it works fine, the only way I can duplicate your error is to remove the above.

It might also be because you seem to be using a CPT called "photos", have you made sure it supports the right parameters, specifically supports 'thumbnail'?

In order to use that function you need to declare this in your theme.

add_theme_support( 'post-thumbnails' );

I tested your code and it works fine, the only way I can duplicate your error is to remove the above.

It might also be because you seem to be using a CPT called "photos", have you made sure it supports the right parameters, specifically,

// rest of your CPT params
'supports' => array('thumbnail'),

http://codex.wordpress.org/Function_Reference/register_post_type

You can test this quickly by trying,

add_post_type_support( 'photos', 'thumbnail' ) 
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

In order to use that function you need to declare this in your theme.

add_theme_support( 'post-thumbnails' );

I tested your code and it works fine, the only way I can duplicate your error is to remove the above.

It might also be because you seem to be using a CPT called "photos", have you made sure it supports the right parameters, specifically supports 'thumbnail'?