Add this code to your theme’s functions.php file:
function add_media_upload_scripts() {
if ( is_admin() ) {
return;
}
wp_enqueue_media();
}
add_action('wp_enqueue_scripts', 'add_media_upload_scripts');
This will cause the the media upload files to load on your front end pages. If you would like to load them only on one specific page where they will be needed, you can wrap wp_enqueue_media()
in an is_page()
statement to check to see if the page being displayed is the specific page you need.
After that, you can follow the instructions in this tutorial: http://codestag.com/how-to-use-wordpress-3-5-media-uploader-in-theme-options/
Related Posts:
- Users can’t upload images on frontend if they haven’t got access to the wp backend
- Upload PDF and other files from the Front-End
- Restrict Users to Only Edit Media Owned by Users in Their Role
- Front-End Upload media with category
- Using Gravity Forms to upload media into library, then attach to post
- Link or button to open the media manager from frontend
- Trigger refresh for new media manager in 3.5
- Physical organization of wordpress media library (Real Media Library plugin)
- Extend Media Library
- WordPress 3.5: Setting custom “full URL path to files” in the Media Library?
- How to show all available images in WP’s media library when using the Polylang plugin?
- Upload post thumbnail from the front end
- Give users a maximum upload capacity; limit the number of files a user can upload OR limit the number of files per upload
- Media upload finished hook
- How can I batch delete all unattached images with WP-CLI or other automated process?
- Which filters or actions to use after a media upload and delete?
- Media not actually deleted on disk when click “Permanent Delete”
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to wp_upload_bits() to a sub-folder?
- How to restrict images in v3.5 Media Library modal to only those from a specific post id?
- “Add Media” only shows “Full Size” under Attachment Display Settings
- Where do the favicons for Media Files come from
- WP 3.5 media manager – how to create a working gallery frame
- What might cause a POST to wp-admin/async-upload.php to return JSON >and< HTML?
- Is it possible to trigger some JavaScript when Media Popup is opened?
- How to call WP3.5 Media Library manager?
- Disable media library tab for non admins in uploader screen
- Why are double-periods (“..”) invalid in a WordPress image filename?
- How can I speed up a slow loading media library?
- Password protect some uploaded files, so only logged-in users can view them
- What to do with unattached logos and header uploaded via native wordpress uploader?
- wp_editor with media buttons
- How to protect uploads in multisite if user is not logged in?
- Append button to WordPress Image Details modal
- Change URLs for static content
- uploading files to the uploads folder via ftp
- Add item to media library from blob or dataUrl
- front end post with multiple upload images?
- Frontend Simple Local Avatar upload
- add_image_size creating lots of images (of various sizes)
- How to get the image url in the input box from media library?
- Remove upload_files capability from a role but allow role to manage an avatar image
- WP3.5 Media Uploader – how to make it accept multiple images?
- Create custom tab in WordPress 5 media upload
- Restrict file uploads by extension?
- How to Check Disk Space used by Media Library
- Trying to add filename over image in Media Browser
- How to change the image size in new Media Uploader (ie use medium vs thumbnail)
- Plugin to Import Dropbox Files into Media Folder from the Cloud [closed]
- How to disable WordPress Media resize different size version?
- Image uploading stuck on “crunching”
- Add media attachment filter to custom wp.media frame
- Change the size of the image preview on the media edit page
- insert post & Upload post thumbnail from the front end using ajax
- Media library storing files in uploads not folders within in uploads
- Add select field to media uploader that adds a class to the image
- Close the media-upload thickbox right after upload is finished?
- Is there a limit on the number of attachments?
- How to change upload directory based on frontend form input name or ID?
- How to host different file formats/types for a media attachment without creating multiple attachments?
- WordPress won’t generate image sizes for certain images
- Resize the WP media Uploader iFrame
- Site icons with alpha channel for self-hosted WordPress blog network
- how to use media library [closed]
- Can I stop wordpress generating media sizes
- wp_enqueue_media() Will not load JS on the theme
- How do I get allowed Media Library upload file extension list?
- Cannot upload .mp3 file to wordpress media
- Replacing Images in Media Library
- How to upload unknown file type?
- Custom “Insert into Post” button
- How to use MediaUpload outside of editor
- Uploading images on front end doesn’t generate thumbnail sizes
- Allow only attachment uploaded to current post
- Switch between tabs on “Insert Media” dialog
- Use custom image size in admin panel
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Display attachments by the ID of the post being edited in the wp.media frame (frontend)
- Update image via WP REST API
- Prevent a folder from being shown within the media library
- Media Library does not show the uploaded image
- Is It Possible to Upload Certain Attachment Files To A Remote Server
- Error uploading image in WordPress
- Attach Thumbnail Generated from Video Upload as Featured Image for the Video
- move_uploaded_file() not working on wordpress front end
- Stop WordPress from generating redundant image size
- WordPress 4.9.8 Trying to add filename over image in Media Browser
- WordPress Issue : The uploaded file could not be moved to wp-content/uploads/
- Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically
- wordpress media upload given An error occurred in the upload. Please try again later
- After moving from complete AWS setup to a standalone WordPress Server, Media/Image Files are Broken
- Using wp_enqueue_media() with switch_to_blog() issue
- Front-End Social photo upload [closed]
- Duplicates and other problems in Media Library
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- WordPress Media frame pre load images from ids
- Uploading .mp3 files http error – 2 “exact” files one successful other fails
- Media library only shows for admin. Doesn’t show editor or below [closed]
- WordPress Uploads Directory not using dates in links
- Upload featured image from front end using media-upload.php