Custom post type: meta box for adding an image?
Hey all, I’m learning custom post types, custom taxonomies, and custom meta boxes at the moment. Getting the hang of things but I hit a roadblock and have been googling for hours with no luck.
Right now I’m learning how to make meta boxes. I want the user to be able to add a product image. I know WP now has this new media uploader, but I want to be able to make things as simple, straight-forward, and restricted (fool-proof) as possible. Furthermore, I’ll need to take that image they upload it, and display it in the relevant [name]-single.php. So I need the hook. How do I get this?
Sorry for what seems like a very simple question. If anyone could even just point me in the right direction for a tut or something, that’d be wonderful. Thanks for your time!
The way that I’ve done this before is probably a bit more complicated then you’re looking for, but it’s a good example.
That’s just my own way of doing it for the jobs that I’ve done in the past. There’s a lot more ways to get around it, so I’d also be happy for anyone else to give a hand with an alternate idea.
Hmm… sounds interesting. I eventually want to build custom post-types and backends meant for clients, and of course you gotta child-proof the whole thing so they don’t get lost or break things. So To be able to have like a single meta box for “upload product image” and there’s the button for uploading and it shows the thumb, that would be perfect.
Do you know of any tuts or resources I can look at for this? I’m still not “fluent” with WP and am very much still copy+pasting snippets and editing them to my needs as I become familiar with the plethora of classes and functions and the syntax for everything! (I would dig through the codex more but tbh it really only presents info about each element and not much about how to use them together in the way that I want to)
- The topic ‘Custom post type: meta box for adding an image?’ is closed to new replies.