MultiPostThumbnails for Custom Post Type

All I apologize the code above was not completely working. I did research and found out how to condense the code for Multipostthumbnails so you can easily include the added thumbs for page, post and/or custom post types. Please let me know if you have a cleaner method.

    add_theme_support( 'post-thumbnails' );
    require_once('lib/multiple-post-thumbnails/multi-post-thumbnails.php'); /* Must be located directly under lib folder */
    // Define additional "post thumbnails". Relies on MultiPostThumbnails to work
    if (class_exists('MultiPostThumbnails')) { 

    $types = array('page', 'landing_pages' ); /* 'landing_pages' adds support for landing pages CPT,  'post' adds support for blog single pages */
    foreach($types as $type) {
    new MultiPostThumbnails(array('label' => '2nd Feature Image', 'id' => 'feature-image-2', 'post_type' => $type)); 
    new MultiPostThumbnails(array('label' => '3rd Feature Image', 'id' => 'feature-image-3', 'post_type' => $type));
    new MultiPostThumbnails(array('label' => '4th Feature Image', 'id' => 'feature-image-4', 'post_type' => $type));
    new MultiPostThumbnails(array('label' => '5th Feature Image', 'id' => 'feature-image-5', 'post_type' => $type));
    }

    };

Then in your page templates place this code where you wish the image to appear:

    if (class_exists('MultiPostThumbnails')
    && MultiPostThumbnails::has_post_thumbnail('landing_pages', 'feature-image-2')) :
    MultiPostThumbnails::the_post_thumbnail('landing_pages', 'feature-image-2', NULL /*, 'add class name here' */ ); endif;

You can change where it says

    'landing_pages' 

to page or post if you are displaying on a page or a single page (blog post). The landing_pages is a custom post type I created.

Hope this helps and again if anyone has cleaner code please share.

error code: 523