Ordered Thumbnails is a WordPress plugin that allows you to display thumbnails based on images that have been attached to a post. This plugin also allows you to specify which thumbnail appears next to a post with multiple images by ordering the thumbnails in the Gallery tab of the WordPress “Add Images” lightbox and placing the thumbnail desired in the first position.
To style how the thumbnail appears on your page, you may pass optional CSS class names to the plugin, which will then be applied to the
<img> tag returned. Alternately, by setting the display parameter to “false”, Ordered Thumbnails will return the thumbnail URL, height, and width as a PHP array to be used however you see fit. If no images have been attached to a post, the plugin fails gracefully and returns “false”. This plugin will work anywhere the WordPress posts loop is used and works particularly nice in combination with
the_excerpt for archive pages.
- Why can’t I change which thumbnail is used?
While the plugin will show thumbnails and will not break in WordPress 2.5, the ability to order the Gallery images was not added until 2.6.
- Will this plugin work for images not uploaded through WordPress?
Short answer: no. This plugin relies on the way images are attached to a particular post when they are uploaded through WordPress. Images hotlinked from other sites (or even linked to a place on your own server not controlled by WordPress) are not tied to the post as attachments in the WordPress database.
- Some of my images are just image links, some are uploaded through WordPress. Will this plugin break on my site?
No, but the plugin will only show thumbnails for images uploaded through WordPress. For posts with no WordPress uploaded images, no thumbnail will appear.
- How does Ordered Thumbnails work?
This plugin works by first looking for any attachments in the
wp_postsdatabase table that have a
post_parentID that matches the current post and as a second step for posts with multiple image attachments, returning the attachment with its
menu_orderfield set to “1”. If no image attachments match the current post ID, the plugin returns “false”.
- Initial release version.