what is the best practice to create your own functions within drupal? should i add them to the template.php file since drupal already reads functions from there? or should i create my own file and use the "require();" statement?

Comments

mooffie’s picture

If these functions aren't related to theming (or even if they are), you can put them in a custom module. Name this module after your site. A module at minimum is two files:

mymodule.info with a "name = my module" line (and with a "core = 6.x" line in Drupal 6).
mymodule.module with a "<?php" at top.

Then go to your modules page and enable the module.