• acheta

    (@acheta)


    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

    (@kafkaesqui)

    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

    (@acheta)

    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.