Title: Functions.php scope
Last modified: August 19, 2016

---

# Functions.php scope

 *  [jpdimond](https://wordpress.org/support/users/jpdimond/)
 * (@jpdimond)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/)
 * I wrote a form for my template and have a php file that processes the form. I
   would like to include the functions.php file in my process form php file so that
   I can call various functions from it (such as creating a new draft post with 
   the form data) But when i include functions.php in the processForm.php, it doesn’t
   recognize all the wordpress functions like add_filter etc.
 * Basically, I don’t understand how new php files in a theme can understand wordpress
   directives.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/#post-1843417)
 * This might help:
 * [http://wordpress.org/support/topic/using-theme-options-in-css?replies=6#post-1479101](http://wordpress.org/support/topic/using-theme-options-in-css?replies=6#post-1479101)
 *  Thread Starter [jpdimond](https://wordpress.org/support/users/jpdimond/)
 * (@jpdimond)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/#post-1843422)
 * Thanks much for the link!
 * So is there anything so bad with just doing this?
 * require_once(“path/to/wp-load.php”);
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/#post-1843475)
 * A lot of plugins do that, but it is not the best way in my opinion. I think the
   main problem with doing something this way is that is the path to wp-load.php
   may change if a blog stores the WordPress files in a different folder to the 
   actual WordPress site.
 *  Thread Starter [jpdimond](https://wordpress.org/support/users/jpdimond/)
 * (@jpdimond)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/#post-1843485)
 * Hmm. Yeah I’m wondering if that will work with multisite as well.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Functions.php scope’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 2 participants
 * Last reply from: [jpdimond](https://wordpress.org/support/users/jpdimond/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/functionsphp-scope/#post-1843485)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
