WordPress.org

Ready to get started?Download WordPress

Forums

Adding media uploader to option in a Options Panel in a custom theme (1 post)

  1. staceyzav
    Member
    Posted 2 years ago #

    Hi - I am developing a custom theme and have included an options panel so the user can add images to the home page slideshow. I have come up with the following code on my functions.php file that allows the user to input the address of the image and it works fine.

    array( "name" => "IMAGE #1 - enter URL of Image",
    	"desc" => "Enter the link to an image used for the homepage slideshow.  Image must be 1100 pixels wide x 720 pixels high",
    	"id" => $shortname."_header_img",
    	"type" => "text",
    	"std" => ""),

    My question is this: how do I make use of the media uploader instead of asking the user to input the address, I'd like them to be able to upload it in this area OR type in the address. I would like to be able to keep all the work I did for the options panel in tact, so I'm hoping I can use this type of code, but I'm not sure what else I need to do to enable the function to work.

    array( "name" => "IMAGE #1 - enter URL of Image",
    	"desc" => "Enter the link to an image used for the homepage slideshow.  Image must be 1100 pixels wide x 720 pixels high",
    	"id" => $shortname."_header_img",
    	"type" => "upload",
    	"std" => ""),

    Thanks in advance for any help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.