We’re delighted to announce our latest plugin, Custom Post Type Images, for WordPress (tested from 3.0 onwards)! WP has made adding and registering custom post types very easy, moving the platform toward further CMS status. However as all these types have emerged, there lacks a way to attach an image and call it in your custom post type archive or even a single post or page. Enter cptImages! Using our plugin you can set a kind of “featured image” for your actual post type without setting them independently.
To use, select an image for the custom post type and attach. You can then use the image in various ways:
As a shortcode. Put [cptImage] wherever you want the image to appear. Not that in this usage (without a parameter) it will only appear when you are on a single item of that custom post type OR in the archive page itself. To call any attached image, use [cptImage cpt=”Custom Post Type Name”].
In PHP in your template. To retrieve the image url to a variable, use
For example, you can use
get_cptimage_image("Custom Post Type Name")
to retrieve a specific post type image, or
get_cptimage_image("Custom Post Type Name", true)
to echo the url rather than retrieving it. To merely display the image, call
cptimage_image("Custom Post type Name")
Note that if you do not pass a post type name it will only appear when you are on a single item of that custom post type OR in the archive page itself.