Create a folder if it doesn't already exist
Asked 07 September, 2021
Viewed 2.1K times
  • 67
Votes

I've run into a few cases with WordPress installs with Bluehost where I've encountered errors with my WordPress theme because the uploads folder wp-content/uploads was not present.

Apparently the Bluehost cPanel WordPress installer does not create this folder, though HostGator does.

So I need to add code to my theme that checks for the folder and creates it otherwise.

20 Answer