Back to Top

How to create directory in WordPress Upload folder

To Create own directory in Wordpress Upload folder

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.

    $upload = wp_upload_dir(); // information of current upload directory
    $upload_dir = $upload['basedir']; //to use base path to the 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)

  1. Hi there! Someone in my Myspace group shared this website with us so I came to give it a look.
    I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers!
    Wonderful blog and amazing design.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How To Use The HTML5 Notification API

Posted on 2 years ago

Bhumi

How to Fetch Twitter data using cURL

Posted on 6 years ago

Bhumi

How to connect to MySQL database using PHP

Posted on 6 years ago

Bhumi

Basic Github commands

Posted on 3 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 3 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 4 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 5 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 5 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 5 years ago

Bhumi