Title: Image uploader inside custom post widget
Last modified: August 30, 2016

---

# Image uploader inside custom post widget

 *  [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * (@oneruffryder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/)
 * I’v built a custom widget that will show some sport scores. Scores are added 
   trough custom post. When i open new custom post(scores) i enter their team names,
   score, scores. Now i want to add an option to show team logos next to the team
   name. In the last couple of days every tutorial here and elsewhere i could find
   didnt worked. I have no idea why, as i am newbie with all this. With many of 
   it, upload button appears but the pop up to chose/upload image doesnt appear.
   Now I could post at least 10 links where i found this codes but i believe there
   is a limit with link. So for an example this is most common tutorial i have found.
 * [Large code excerpt removed by moderator per [forum rules](https://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use [the pastebin](http://wordpress.pastebin.com/) for all large code 
   excerpts. It works better anyway.]
 * what exactly is this ‘my_plugin_page’ i guess i am doing something wrong and 
   that’s why uploader doesnt pop up. What i need to add instead of it, any example?
 * Inside my theme i’v made a new folder called my-plugin inside which i added my-
   admin.js with the script code from the link above. Is this the right way?
 * I also tried other way without it and calling the script by get_template_directory_uri().
 * Any help pls.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * (@oneruffryder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438355)
 * This is a pastebin url with the code i am trying to use
 * [http://pastebin.com/JmWCZd7x](http://pastebin.com/JmWCZd7x)
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438361)
 * Sorry, but I’m having trouble figuring out what you mean when you say:
 * >  I’v built a custom widget that will show some sport scores. Scores are added
   > trough custom post. When i open new custom post(scores) i enter their team 
   > names, score, scores.
 * So you want to add an image in the widget or in a post? If you are using a widget,
   why not just use a plugin like – [https://wordpress.org/plugins/black-studio-tinymce-widget/](https://wordpress.org/plugins/black-studio-tinymce-widget/)
   
   it has a media file uploader in there already.
 *  Thread Starter [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * (@oneruffryder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438392)
 * Hi Cristine,
 * > So you want to add an image in the widget or in a post?
 * I want to add image in my situation small logos inside custom post, and those
   images (logos) will be shown on the frontend of widget.
 * Now i have a normal widget (i registered custom posts inside function.php and
   i added score.php widget) and a plugin (mix of previously explained two). With
   both way i cant figure it out which uploder doesnt pop up.
 * So let me explain, i registered custom posts called score. Inside those custom
   posts i have fields to enter stuff like team name, team 1 score, team 2 score.
   There i want to add team logos (images) as well and that’s why i am seeking for–
   image upload option.
 * So inside custom score post i would call twice logos for both teams. And i tried
   many codes, button shows up, but it doesnt offer image uploder. Like it doesnt
   work.
 * This is my code of the plugin
 * [http://pastebin.com/7mC6QpHQ](http://pastebin.com/7mC6QpHQ)
 * And again the code with which i am trying to solve this
 * [http://pastebin.com/JmWCZd7x](http://pastebin.com/JmWCZd7x)
 * I think i tried every solution i could found, but no luck.
 * Just starting to learn wordpress.
 * Kind regards, any help really appreciated
 *  [bruler](https://wordpress.org/support/users/bruler/)
 * (@bruler)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438426)
 * i have problem with this
 *  Thread Starter [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * (@oneruffryder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438449)
 * Hi Bruler, what problem do you have?
 *  Thread Starter [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * (@oneruffryder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438459)
 * Ok, I managed to get it working, but now the issue is, it doesnt save it. So 
   what now?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Image uploader inside custom post widget’ is closed to new replies.

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 6 replies
 * 3 participants
 * Last reply from: [oneruffryder](https://wordpress.org/support/users/oneruffryder/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/image-uploader-inside-custom-post-widget/#post-6438459)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
