I am new to theme development. I am trying to create a custom metabox that has the ability to upload a image. I am doing this on a page not a post. I want to output the images (multiple) onto the page in a unordered list. I have attempted to use WP alchemy, and I can only get as far as getting the metabox to show up but I have no idea on how to output the imgurl to the page. Is there a better way to upload multiple images to a page which is easy for a client and doesn’t add images to the content editor (I just think it isn’t user friendly) and then output them to a page in a unordered list. Some advice please.
Leave a Reply
You must be logged in to post a comment.
That’s pretty advanced and it doesn’t sound like you are all that comfortable with WP yet, no offense. You can definitely do this with WP Alchemy (I have and do), but you really have to get down and dirty with some Javascript to 1. launch the media uploader and 2. to hijack the send to editor function.
some good reads:
http://austinpassy.com/snippets/wordpress/creating-custom-metaboxes-and-the-built-in-uploader/
http://www.krishnakantsharma.com/2012/01/image-uploads-on-wordpress-admin-screens-using-jquery-and-new-plupload/
As far as alternatives: you might want to try the the Metabox class by Rilwis.
http://www.deluxeblogtips.com/meta-box
or Advanced Custom Fields
http://www.advancedcustomfields.com/
Both are much less DIY than Alchemy. I’m pretty sure the one by Rilwis even has the plupload drag and drop uploading and a simple way to turn on repeating fields.
I code a plugin today allowing this feature. It is very simple to use :
Install the plugin and activate it. You can now link multiple images to your posts by the way of metabox. Pictures can be reordre in drag & drop.
Number of picts and targeted post types can be overited by hooks.
http://wordpress.org/extend/plugins/multi-image-metabox/