Store images and videos category wise and fetch them in json format

Some how able to get all the images from media library. This is very close. $query_images_args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => – 1, ); $query_images = new WP_Query( $query_images_args ); $images = array(); foreach ( $query_images->posts as $image ) { $images[] = wp_get_attachment_url( $image->ID ); }

Create media library feed

Although your question appears to be about an xml feed for library images, the process to display those images on a page requires use of a template with a special query to look for ‘attachment’ type pages, which is how images are stored in the database. That’s a bit more complicated, but I did something … Read more

WordPress Media Library

Hi unless you’ve backed up your files there’s no other way to retrieve images except for asking your webhost to see if they have a backup. My host does, and keeps it for 30 days before deleting the backup, so that’s what I’d try first. In future, make sure you back up your sites regularly.

Use the “Media Library” in Frontend

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