1

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.

1
  • Im developing a Plugin to do something like it, but my short answer is: it's not a easy task if you are trying to achieve the same upload form as in the Light Box. But you can always use a link to the LightBox uploader, and the retrieve the URL using JavaScript. I have this code right here, I can post it as an Answer, if that is what you want.
    – Webord
    Feb 23, 2012 at 17:49

2 Answers 2

1

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. enter image description here

That results in: enter image description here


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

0

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.

1
  • A link is considered a poor answer, expand on the fix found on the page. Even if it's just a quick summary with some code examples. Nov 15, 2012 at 4:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.