Cache DB queries result

As long as you use WP API ($wpdb) to perform queries, they will be cached by caching plugins (well, by those that have such functionality). If you need to cache data that is more compelx to generate rather than just retrieve look into Transients API.

Display post image in a size defined by add_image_size()

Try using wp_get_attachment_image() (Codex ref)? echo wp_get_attachment_image( $attachmentid, $imagesize ); Where $attachmentid is the attachment ID, and $imagesize is the name of the image size in the add_image_size() call. EDIT For a custom-field stored image SRC URL, I’m not finding any way to make use of intermediate image sizes defined via add_image_size() (or even the … Read more

Get image path : image is upload but not attached

This is not very reliable in general (especially not in multisite environment), but for specific case it can be good enough: $url=”http://localhost/wp-content/uploads/2011/06/sample.jpg”; $uploads = wp_upload_dir(); $path = str_replace( $uploads[‘baseurl’], $uploads[‘basedir’], $url);

Right click&copy images: protection

This functionality is Plugin territory. I strongly believe that the WordPress core team will never consider such functionality for WordPress core. Besides: such functionality is also pointless. Anyone who wants an image badly enough is going to be able to get them. (They can disable javascript thereby defeating the Plugin entirely; they can view source … Read more

Images don’t update after being edited

When you upload an image via the media library, additional sizes are created: large, medium, thumbnail, plus any additional sizes defined by plugins or your theme. If your theme displays any sizes other than the original, un-resized image, you’ll have to regenerate those additional sizes to see any changes take effect. If this is the … Read more

Get thumbnail URL :)

You are not using set_post_thumbnail_size properly. Try with: add_image_size( ’emphasis’, 132, 82, true );

A little confused as to what add image size actually does

Your not specifying a $crop value so your images are being cropped using a soft proportional crop. Set crop to TRUE for a hard crop. add_image_size( ‘sidebar_thumb’, 46, 60, TRUE); *no need to call function_exists for add_theme_support or add_image_size unless you want to be backwards compatible to pre 2.9.