I would simply like to do some WordPress theme development using statements like

        require get_template_directory() . '/functions/base.php';

in my functions.php file. It seems IDEs do not know what to make of this function result and therefore do not map out [theme root]/functions/base.php as expected.

1 Answer 1


In the process of looking this up I determined the correct answer is to use the full local path in my dev environment, and add a comment in the code like

/** @define "get_template_directory()" "/home/myuser/mywpproject/wp-content/themes/mytheme" */

And this works for the subsequent references in that file in JetBrains IDE / PHPStorm immediately. Thanks to here by Jeff Behnke. I have not checked this on other IDEs. As this is a comment I believe it should not affect server side execution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.