admin管理员组

文章数量:1122826

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:

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:

Share Improve this question edited Oct 27, 2016 at 12:53 buckdanny asked Oct 27, 2016 at 11:29 buckdannybuckdanny 1258 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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/)

本文标签: Use the quotMedia Libraryquot in Frontend