Info
- 5 posts
- 4 voices
- Started 2 years ago by Derek Herman
- Latest reply from _ck_
- This topic is not resolved
functions.php
-
- Posted 2 years ago #
Is there a file you can add to BBpress themes that is the equivalent to WP's functions.php?
-
- Posted 2 years ago #
I don't think there is:
http://bbpress.org/forums/topic/admin-panels-like-wpI think most people create a single plugin and drop all their miscellaneous functions in there:
http://bbpress.org/forums/topic/show-me-all-your-mini-plugin-functions -
- Posted 2 years ago #
Actually, it's exactly the same (at least in 1.0) as WordPress's functions.php. Same name, same everything.
-
- Posted 2 years ago #
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.
-
- Posted 2 years ago #
You can emulate the
functions.phpin theme directories quite easily in 0.9Put this into a regular plugin and I suggest naming it
_functions.phpwith a leading underscore so you don't even have to activate it. Install it and then when afunctions.phpis 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 theheader.phpinside of the templates if you are making a theme you want to distribute for 0.9 -
You must log in to post.