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 badges1 Answer
Reset to default 0Add 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
版权声明:本文标题:Use the "Media Library" in Frontend 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736286015a1927580.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论