orangutansolutions
Sophomore
Just Getting Started
Member Likes (0)
We are creating a custom theme for our WPMU (with pro sites and a few other plugins installed) for our customers.
However my programmer and I are stuck in trying to figure out how to upload an image on the themes option page without asking users to just put the link to the file.
For example, for the homepage, we would like to allow them to upload 5 images to be placed in a rotator, once they've uploaded the images, they'd be inserted automatically, rather than using shortcodes or URL links.
Any help would be greatly appreciated :)
Cheers,
-William

Responses (6)
Support Chimp (joined March 2010) Likes (0)
Hey there.
Has your developer created an option panel yet?
You would create those theme options with input fields. Then use the media library to upload the images and insert them into fields. And pull the data by looping through an array.
As you mentioned you have a programmer I presume he/she will be good with that direction?
The best example though would be to look at a theme and see how its done there.
Take care.
Support Chimp (joined March 2010) Likes (0)
Hey how is your programmer going with this? I guess s/he has it sussed now?
I thought they might, but just wanted to check in.
Take care.
Member (joined March 2012) Likes (0)
Hi Timothy,
Yeah we've got the options pages up and running no problem, still trying to get the images to upload and called back to the options page to work.
Basically what your saying is to reuse the media upload function already in Wordpress, but calling it from our option page?
Is this how a plugin like nextgen gallery does it? Or does he use a different method?
Cheers,
-William
Support Chimp (joined March 2010) Likes (0)
Pretty much.
Look at how this works when making a post for example.
You click the the media library, upload the image, insert the image and thats it.
It then forms part of the content, so when pulled it comes through as content.
Well you would be doing the same thing, except your not inserting into an editor but instead just a text field which is an option on your options page.
You would then loop through all the fields you make to pull the date.
Not sure about Nextgen, its been a while since I really had a good play with it.
Look at Twenty Eleven, the header upload option. There you can select from the media library or upload.
Some themes allow the user to select a category and then take the featured image for use. Thats another way.
These do it a slightly different way:
http://wordpress.org/extend/plugins/easy-image-slideshow
They have an image folder they read from and you set the path in the admin.
And the next one looks to be using Custom Post Types for this sort of thing which is pretty cool:
http://wordpress.org/extend/plugins/fancy-heaer-slider/screenshots/
And another one:
http://wordpress.org/extend/plugins/meteor-slides/
I've used this one, it also uses custom post types. I really like it.
You might also like to look at this framework:
http://wptheming.com/options-framework-plugin/
There are a good few options there, your programmer could pick which best suits the project. Using Custom Post Types would mean that if you change themes you can keep that as a separate plugin if needed. Or it could just be part of that theme as an App Theme kinda thing.
Take care.
Member (joined March 2012) Likes (0)
Thanks Tim, will give that a go and thanks so much for the additional information :)
Support Chimp (joined March 2010) Likes (0)
You are most welcome! :)
Become a member