Here, I come with the quick article in WordPress. WordPress is the very secure and lightweight blogging platform.Today I am going to explain how to create the directory into the WordPress upload folder.
WordPress provides a very easiest way to do anything into it and interesting is it does not affect the existing or core functionality of WordPress.
Read: How to display ADMIN Toolbar in UI?
Let’s see the code to create a directory into WordPress upload folder.
1 2 3 4 5 6 7 8 9 | $upload = wp_upload_dir(); // information of current upload directory $upload_dir = $upload_dir . '/myimages'; if (! is_dir($upload_dir)) { mkdir( $upload_dir, 0755 ); } |
That’s you can write above code into functions.php file using add_action or you can place code whenever you require in your file.
Also Read: To create custom size thumbnail in WordPress
Thank you for reading.Feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
Comments (1)