I have additional folder (images/) in wp-content/uploads/ directory to store theme images (I heard it is good practice to place them in upload directory) and I want Media Library to list this files because I might need to reuse them somewhere else. Is there a way to tell Media Library to look for files in whole uploads directory (or manually add directories to look in) maybe using functions.php?
2 Answers
The Media library doesn't directly pull from the uploads
folder. It reads in Attachments, which place their attached media in the uploads
folder. If you want to access them through WordPress, you will need to upload them as Attachments.
-
Great. I have actually found a plugin that can import files from any folder into database which is a great work around this problem. I wouldn't know about this without your answer. Thanks. And this is the plugin: wordpress.org/plugins/add-from-server Commented Sep 9, 2015 at 14:42
You can customize the upload location in the wp-config.php
file.
Just before the line that goes
require_once(ABSPATH.’wp-settings.php’);
add define('UPLOADS', 'path/to/new/folder');
.