Convert uploaded PNG to JPEG automatically

There is a way, I recommend you combine the imagefx plugin with a custom function , http://wordpress.org/extend/plugins/imagefx/ You can read about it here: http://ottopress.com/tag/gd/ , and use a function like one found here: https://stackoverflow.com/questions/1201798/use-php-to-convert-png-to-jpg-with-compression It would look something like (not tested): imagefx_register_filter(‘custom-name’,’my_custom_filter’); function my_custom_filter(&$image, $outputFile, $quality) { $image = imagecreatefrompng(&$image); imagejpeg($image, $outputFile, $quality); imagedestroy($image); } … Read more

Modify featured image URL at runtime

HTML generated by the_post_thumbnail() & get_the_post_thumbnail() can be altered using the post_thumbnail_html filter. This works even when there is no post thumbnail. Example: /** * Filters the post thumbnail HTML. * * @since 2.9.0 * * @param string $html The post thumbnail HTML. * @param int $post_id The post ID. * @param string $post_thumbnail_id The … Read more

How to get_posts having post thumbnail?

The thumbnail is stored as a meta with a key of _thumbnail_id, so that could be used to find posts that have thumbnails. Something like this: $query = new WP_Query(array( ‘meta_query’ => array( array( ‘key’ => ‘_thumbnail_id’, ‘value’ => ‘0’, ‘compare’ => ‘>=’, ) ) ));

Black and White thumbnails

You can use the php GD library which you most likely already have on your server since wordpresses uses it. You can filter the image using imagefilter specifically IMG_FILTER_GRAYSCALE and/or IMG_FILTER_CONTRAST. For example imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_CONTRAST, -100); The hover would have to been done in javascript. A much simpler solution would be to use … Read more

can the_excerpt function also get images?

Ensure that your Theme supports Post Thumbnails, and that the client sets a “Featured Image” for each post. Then, combine the_excerpt() with the_post_thumbnail(), e.g. like so: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <div class=”featured-image”><?php the_post_thumbnail(); ?></div> <div class=”post-excerpt”><?php the_excerpt(); ?></div> </div> … Read more