Is it possible to have an image upload box in a Custom Post Type?
I would like the user to be able to upload specific images just for the CPT.
Is it possible to have an image upload box in a Custom Post Type?
I would like the user to be able to upload specific images just for the CPT.
You must be logged in to post a comment.
Yes, you can do it programmatically and it probably can be built with some of the Related Questions listed here on the right of the page.
But, IMO, this is faster and easier to do with a plugin.
Advanced Custom Fields
Create an image field and associate it with your Custom Post Type.
That results in:
Another good plugin capable of doing the same
Custom Content Type Manager
A nice feature is the “Repeatable Field”, which is a premium add-on in ACF.
Reference Q&A: Creating Photo Gallery System with Custom Post Type
The easiest way is to just use the built in ‘featured image’ option in WP:
http://wordpress.org/support/topic/get-post-thumbnail-featured-image-to-show-up-for-custom-post-types
If you need more than 1 image you’ll have to go the metabox route.