Skip to content

Instantly share code, notes, and snippets.

@anointed
Forked from kunalb/functions.php
Created November 22, 2011 05:19
Show Gist options
  • Save anointed/1384958 to your computer and use it in GitHub Desktop.
Save anointed/1384958 to your computer and use it in GitHub Desktop.
Overriding the default bbpress theme
/**
* Set the theme compat theme properties
*
* @since bbPress (r3311)
*
* @global bbPress $bbp
* @param BBP_Theme_Compat $theme
* @uses current_theme_supports()
*/
function bbp_setup_new_theme_compat() {
global $bbp;
// Check if current theme supports bbPress
if (!current_theme_supports( 'bbpress' ) ) {
$theme = new BBP_Theme_Compat();
$theme->name = 'bbPress (Twenty Ten)'; /* Change to the name you need */
$theme->version = '20110912'; /* Update these as you update the theme */
$theme->dir = WP_PLUGIN_DIR . '/twentyeleven-bbpress-child'; /* You might need to correct this */
$theme->url = plugins_url('twentyeleven-bbpress-child'); /* Ditto */
// Set the theme compat globals for help with loading template parts
$bbp->theme_compat->theme = $theme;
}
}
add_action( 'bbp_init', 'bbp_setup_new_theme_compat', 9 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment