/**
  * Related Posts for WordPress thumbnail function
  *
  * @param int $post_id
  * @param string $post_type
  */
 function rp4wp_thumbnail($post_id, $post_type)
 {
     // get thumbnail
     $thumbnail = RP4WP_Thumbnail_Helper::get()->get_thumbnail($post_id, $post_type);
     // only output $thumbnail if not empty
     if (!empty($thumbnail)) {
         echo $thumbnail;
     }
 }
 public function run()
 {
     // post type manager
     $pt_manager = new RP4WP_Post_Type_Manager();
     // get installed post types
     $post_types = $pt_manager->get_installed_post_types();
     // check & loop
     if (count($post_types) > 0) {
         foreach ($post_types as $parent => $children) {
             // add thumbnail for post type
             RP4WP_Thumbnail_Helper::get()->register_thumbnail_size($parent);
         }
     }
 }