Actually, it’s exactly the same (at least in 1.0) as WordPress’s functions.php. Same name, same everything.
So it’s only available in 1.0 huh, that sucks cause I think the forum is still using 0.9 something.
The way I’m doing it now is creating a plugin like chrishajer mentioned but it just seems odd to me as a prolific WP user. Unfortunately I’m not sure the forum can be upgraded since the Envato devs had to integrate it with a RoR app and hacked the core. Hopefully they can upgrade it cause the theme I’m working on is crazy complex and I had to add a lot of extra functions to my plugin to make the theme work based on the design. I just think some of the code I wrote is probably included in the 1.0 core.
You can emulate the functions.php
in theme directories quite easily in 0.9
Put this into a regular plugin and I suggest naming it _functions.php
with a leading underscore so you don’t even have to activate it. Install it and then when a functions.php
is found inside the currently active theme, it will be loaded with the regular plugins. Since it’s so tiny, if you have a collection of mini-plugins you can just put it in there instead.
<?php
/*
Plugin Name: functions.php
*/
$template_functions_include = bb_get_active_theme_directory() . 'functions.php';
if ( file_exists( $template_functions_include ) ) { require_once( $template_functions_include ); }
?>
In theory you might even be able to put that code into the header.php
inside of the templates if you are making a theme you want to distribute for 0.9