Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created October 2, 2012 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkingorg/3822786 to your computer and use it in GitHub Desktop.
Save alexkingorg/3822786 to your computer and use it in GitHub Desktop.
Add thumbnail support for a post type without stomping old types.
$thumbnails = get_theme_support('post-thumbnails');
if (is_array($thumbnails)) {
add_theme_support('post-thumbnails', array_merge($thumbnails[0], array(self::$post_type)));
}
else if (!$thumbnails) {
add_theme_support('post-thumbnails', array(self::$post_type));
}
// else already enabled for all post types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment