add_image_size and add_filter(‘image_size_names_choose’, ‘my_custom_image_sizes’) not working with wordpress 3.5.2

I’m running WordPress 3.5.2. The following is an excerpt from my functions.php file, which correctly allows me to select a thumbnail size when I upload an image. // Basic setup for thumbnail support. function themeSetup() { add_theme_support(‘post-thumbnails’); add_image_size(‘tiny’, 128, 79); add_image_size(‘small’, 256, 158); add_image_size(‘medium’, 384, 237); add_image_size(‘large’, 512, 316); } add_action(‘after_setup_theme’, ‘themeSetup’); // Addes custom … Read more

Filter For Featured Image

The post featured image ID is stored as post metadata, so I would recommend hooking into the update_post_meta or update_post_metadata hooks, and then query the post meta for ‘_thumbnail_id’ being set. See this related answer from Jan Fabry.

Display the first image from a post in RSS feed

Here’s what I use in Dave’s WordPress Live Search to get the first image: public static function firstImg( $post_content ) { $matches = array(); $output = preg_match_all( ‘/<img.+src=[\'”]([^\'”]+)[\'”].*>/i’, $post_content, $matches ); if ( isset( $matches[1][0] ) ) { $first_img = $matches[1][0]; } if ( empty( $first_img ) ) { return ”; } return $first_img; }