Stephen
Stephen

Reputation: 79

I want to make directory to current active theme in wordpress

I am developing a plugin wherein i want to make a /CSS/ directory in the currently activated theme.

using get_template_directory_uri() not working because its https:// path. I want an Absolute directory for making dir.

Here is code i am using:

$directoryName = ''.get_template_directory_uri() .'/css/';
if(!is_dir($directoryName)){
  mkdir($directoryName, 0755, true);
}

Upvotes: 0

Views: 96

Answers (1)

TobyU
TobyU

Reputation: 3918

To get the path on the file system, you need to use:

get_template_directory()

instead of:

get_template_directory_uri()

Upvotes: 2

Related Questions