Title: calling functions/php-files
Last modified: August 18, 2016

---

# calling functions/php-files

 *  [acheta](https://wordpress.org/support/users/acheta/)
 * (@acheta)
 * [20 years ago](https://wordpress.org/support/topic/calling-functionsphp-files/)
 * Hi,
    I wrote two new functions in template-functions-post.php concerning the 
   behavior of single pages.
 * I would like to put these functions into a new ‘pagesbehavior.php’ so that my
   functions aren’t deleted when an update overwrites the existing temmplate-functions-
   post.php.
 * My only problem is that I don’t know how wordpress knows which *.php-file it 
   has to call to retrieve the corresponding function. So, how does <?php wp_list_pages(”);?
   > for example know that it must call template-functions-post.php to get the function
   wp_list_pages? It doesn’t call every php-files in the include-folder, does it?
 * Grateful for any help.

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years ago](https://wordpress.org/support/topic/calling-functionsphp-files/#post-366099)
 * I don’t understand the *entire* hierarchy of php scripts in WordPress, but I 
   do know that most of this is handled through wp-settings.php. Anyway, here’s 
   some options I can suggest:
 * 1. Place your custom functions in a plugin.
 * 2. Add a functions.php to your theme and drop your functions in there.
 * 3. Include your pagesbehavior.php at the very end of wp-config.php (after wp-
   settings.php is included).
 *  Thread Starter [acheta](https://wordpress.org/support/users/acheta/)
 * (@acheta)
 * [20 years ago](https://wordpress.org/support/topic/calling-functionsphp-files/#post-366111)
 * thanks a lot. the plugin-method is actually what I was looking for.

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

The topic ‘calling functions/php-files’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [acheta](https://wordpress.org/support/users/acheta/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/calling-functionsphp-files/#post-366111)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
