Answer the question
In order to leave comments, you need to log in
Where to paste code to change upload folder in Wordpress?
Friends, tell me in which file to insert the code to change the file download directories?
The problem is, 90,000 are loaded into one folder (the month of January), which is too much. I want to break it down by date. Uploading files via Wp All Import.
Received advice from the developers. But I'm not a programmer. How to use it?
"If you mean that you want to import images to a different folder, you would need to write some custom PHP code tied to the upload_dir WordPress hook. Here's a basic example where we added a date to the folder:
add_filter('upload_dir', 'add_date_to_upload_dir');
function add_date_to_upload_dir( $param ) {
$date = date('d');
$dir = '/' . $date;
$param['path'] = $param[' path']. $dir;
$param['url'] = $param['url'] . $dir;
return $param;
}
"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question