0

Is it possible to show the media-library on a frontend template?

I need to use the media-library (/wp-admin/upload.php) as part of a frontend page design with some modifications. I dont want to use the upload-functionality but the list of all images and the functionality you have when clicking on one image... So, I need the css, php and js code of the wordpress media-library.

I could code this from scracth but I like the idea to re-use the wordpress-core code. Where can I find the code in the wp-admin folder and how can i integrate this code on frontend? Thanks alot

Edit:

i dont want to use media uploader i want to display the content of the media library on a page with (more or less) same design and fuctionality as in the backend.

like on this sketch:

enter image description here

-1

Add below code to your current theme's function.php

function add_media_upload_scripts() {
    if ( is_admin() ) {
         return;
       }
    wp_enqueue_media();
}
add_action('wp_enqueue_scripts', 'add_media_upload_scripts');

Further, you can explore more in detail by follow this blog (i.e. https://codestag.com/how-to-use-wordpress-3-5-media-uploader-in-theme-options/)

  • thanks, i edited my question to make it more clear what i need to achieve. – buckdanny Oct 27 '16 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.