I am trying to upload a PHP file to WordPress root folder (www or public_html).
How can I do it ?
I want to implement it on my theme. I tried with move_uploaded_file
, but it's not uploading anywhere.
I am trying to upload a PHP file to WordPress root folder (www or public_html).
How can I do it ?
I want to implement it on my theme. I tried with move_uploaded_file
, but it's not uploading anywhere.
Please add the below code after require_once(ABSPATH.'wp-settings.php'); declaration.
define('UPLOADS', 'files');
Please note that, you have to use the default wordpress media manager instead of your own custom code with "move_uploaded_file".
Please refer, http://www.hongkiat.com/blog/wordpress-custom-upload-dir/
Just use ftp, that's the only easiest way to upload files to your root directory with wordpress. I guess your using webhosting for your wordpress website, login on their website and check for ftp credentials or just ask them for it. Most of the time i use filezilla for uploading files to wordpress. Filezilla