I want to seperate my Option-Page functions and functions.php.
Therefore i moved Option-Page functions to another file "includes/options.php".
Including the file with require_once("includes/options.php") does not work anymore (I am absolutely sure that it worked in past), but require_once("includes/options.inc") is working.
When should i use *.inc files and when *.php files?
Especially when theme or plugin developing.

I have done same as here: Organizing Code in your WordPress Theme's functions.php File?


2 Answers 2


If you are editing theme files use get_template_directory to retrieve the php files. try the code below in your functions.php file.

require get_template_directory() . '/includes/option.php';

Never use relative paths to include PHP files, you just have no real idea relative to what it will end up being. Always find the location of your theme file by doing something like $rootdir = dirname(__FILE__) from your functions.php, and then use include($rootdir.'/includes/options.php')

  • Very helpful. Really good hint.
    – bunower
    Commented Sep 23, 2016 at 9:56

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.