make default upload folder year/month/day wordpress without plugin [duplicate]

Here is a similar question. The simplest solution that worked for me was use the upload_dir filter. Place the code below in your functions.php file. function wpcb_upload_dir_filter($uploads){ $day = date(‘d’); $uploads[‘path’] .= “https://wordpress.stackexchange.com/” . $day; $uploads[‘url’] .= “https://wordpress.stackexchange.com/” . $day; return $uploads; } add_filter(‘upload_dir’, ‘wpcb_upload_dir_filter’);

Theme upload fails

This is cleary a max_upload issue. You are trying to upload a theme with a size bigger then the size allowed. In this case you have two solutions: 1) Use FTP in order to upload you new theme. You got to wp_content\themes and you upload the unzipped folder there. You will then find it in … Read more

How to check if uploaded file is .pdf not .jpeg?

I like to use the following: First I initiate an array of supported mime types: $supportedTypes = array( ‘application/pdf’ ); Next I get my actual uploaded file type: $fileType = $_FILES[‘type’][0] Then I use wp_check_filetype() to get the extension and mimetype: $fileArray = wp_check_filetype( basename( $_FILES[‘name’][0] ) ); Finally I run a conditional to make … Read more

Unable to create directory

First issue is related with ownership of the directory. Second issue is, you will have to make directory within directory so consider using following UNIX command: sudo mkdir -p wp-content/uploads/2014/08 here p flag lets you create directory within directory Third issue is related with the file permissions ( theme-editor.php) use : ls -lah to view … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)