简体   繁体   中英

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);
}

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

get_template_directory()

instead of:

get_template_directory_uri()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM