Custom Post Type Images WordPress Plugin
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 post. What if you want to connect an image to a particular type (a logo, or symbol) and display it everywhere? Or have a nice customizable header for all your books, and one for your movies? Enter Custom Post Type Images which will attach an image to your type and show it on the single page and the archive page.
To use, install the plugin (download from this page or from the WordPress page) and navigate to Tools > Manage Post Type Images. 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.