0

This question specifically deals with the Multiple Post Thumbnails plugin, though the problem may have to do with my installation of WP itself as nobody else seems to have had this problem.

I am using WP 3.0.5, completely stock with the exception of the plugin. As per the instructions, I am initializing the plugin as such:

$video_thumb_secondary = new MultiPostThumbnails(array(
        'label' => 'Thumbnail Image',
        'id' => 'video-thumbnail',
        'post_type' => 'video'
));

The code above is called in a function run during the admin_menu hook.

When attempting to upload/select an image and then clicking on 'Use as thumbnail image' I get the following error: "Could not set that as the thumbnail image. Try a different attachment." I have also tried initializing the plugin with the default 'post_type' of 'post' and have run into the same error.

As I said, I have seen no other documented cases of this error with this plugin, and hardly any at all of this error in general with WP. Hoping somebody can shed some light on it...

** EDIT ** Resolved my own issue. The code above must be run outside of any function in your functions.php file. I naturally assumed that it should be defined in one of the admin menu hooks, but that is not the case.

1 Answer 1

1

You should trigger the function on some other hook like

function add_multiple_post_thumbnails_from_plugin() {  
  new MultiPostThumbnails( array(  
         'label'     => 'Thumbnail Image' 
        ,'id'        => 'video-thumbnail'
        ,'post_type' => 'video'  
  ) );  
}  
add_action( 'admin_init', 'add_multiple_post_thumbnails_from_plugin' );
4
  • You sent me in the right direction in any case @kaiser. Edited my original post with solution.
    – Mike
    Feb 20, 2011 at 21:59
  • you should anyway add this as separate answer and later check it as solution. this belongs to your acceptance rating over here (100% is good). btw: upvoting of my post is always appreciated :)
    – kaiser
    Feb 21, 2011 at 18:59
  • Thanks Kaiser, is it just me or this plugin only allows 2 thumbnails?
    – Zeal
    Jun 3, 2011 at 8:38
  • @Zeal I don't know the Plugin.
    – kaiser
    Jun 4, 2011 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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