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
- How to show all available images in WP’s media library when using the Polylang plugin?
- Upload post thumbnail from the front end
- Which filters or actions to use after a media upload and delete?
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to restrict images in v3.5 Media Library modal to only those from a specific post id?
- Why are double-periods (“..”) invalid in a WordPress image filename?
- How can I speed up a slow loading media library?
- What to do with unattached logos and header uploaded via native wordpress uploader?
- wp_editor with media buttons
- Append button to WordPress Image Details modal
- Change URLs for static content
- Add item to media library from blob or dataUrl
- Frontend Simple Local Avatar upload
- add_image_size creating lots of images (of various sizes)
- WP3.5 Media Uploader – how to make it accept multiple images?
- How to disable WordPress Media resize different size version?
- 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
- Is there a limit on the number of attachments?
- How to host different file formats/types for a media attachment without creating multiple attachments?
- Site icons with alpha channel for self-hosted WordPress blog network
- how to use media library [closed]
- Can I stop wordpress generating media sizes
- Replacing Images in Media Library
- How to upload unknown file type?
- Uploading images on front end doesn’t generate thumbnail sizes
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Update image via WP REST API
- Media Library does not show the uploaded image
- 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
- Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically
- Front-End Social photo upload [closed]
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- 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
- Edit User Profile From Front End
- Multi Upload In Theme Options
- How to load attachment in media library for current user?
- How To Watermark Audio
- Resize existing library images
- Storing WordPress Media Library Uploaded files onto a separate domain
- Media Library Won’t Display Any Images
- A link (not in the post) to download a specific PDF file
- Issue with images which have no sizes available
- Creating a podcast directory site – how to allow user to upload “large” files?
- More Fields & Media Upload
- Migrating media files (documents only) to a fresh install and maintaining the same directory structure
- How does wordpress handle media files?
- WordPress media upload issue could not insert attachment into the database
- Set different max upload size limits based on file type/extension
- Correctly using the root directory for media uploads?
- What is the URL pattern for image thumbnails + sizes?
- Upload and attach to a post multiple image files [closed]
- Changing titles in Uploader for “Posts”
- How to detect when a file has been uploaded?
- Better solution for managing media attachments with `wp_editor()`?
- What if I have a large file on the server that I want the wp library to have?
- Multiple images are generated in WP-content in wordpress
- Removing extra large generated images disables all crops
- How Do I Change the File Permission For Uploaded Files in WordPress?
- MIME types not recognized by media library
- image not display in media library and thumbnail not display in post
- Images uploaded via Gutenberg image block are cropped
- Media Library: Remove replace images of selected author
- Bulk upload images in upload folder does not show in media library
- How to upload multiple images using WP rest API to media?
- Frontend media shows “An error occurred in the upload. Please try again later.”
- Redimension thumbnail crop without creating new images
- Issues with WordPress 3.9.6 media libraries on XAMPP
- limit the access to uploaded files
- How to configure WordPress to create thumbnails
- My deleted media exists jet
- Private file system for attachments
- How to split my uploaded media into directories?
- Metabox with file upload to custom directory
- wordpress 3.6 media manager cropping timestamp
- Is there a way to force Featured image to show as attachement?
- Automatically adding images to a certain page through the Media Uploader
- Bring up the media uploader on click
- How to upload and add images to the existing post from the front-end with admin approval which is posted by other user
- How can comments be turned off for media attachments on WordPress?
- Question regarding the file path for media_sideload_image and wp_upload_dir()
- How do I restore attachment from files in wp-upload
- Image in binary in the data to WordPress media library