Created
October 10, 2018 11:26
-
-
Save pierre-dickinson/156306079ed8c86e58ec9ef0472a31d6 to your computer and use it in GitHub Desktop.
Customize Buddypress Theme Template Stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Buddypress template stack adaptation for Blade Sage.io templating | |
* @link https://roots.io/sage-9/ | |
* example @link http://www.generalthreat.com/2013/08/grappling-with-bp-theme-compatibility/ | |
* | |
* initial url was : | |
* /app/public/app/themes/sage/resources/buddypress | |
*/ | |
// maybe see also : bp_locate_template to test hook | |
function md_bp_blade_register_template_location() { | |
// return '/app/public/app/themes/musicdata/resources/views'; | |
// return STYLESHEETPATH . '/views/buddypress/'; | |
return TEMPLATEPATH . '/views/buddypress'; | |
} | |
if( function_exists( 'bp_register_template_stack' ) ) { | |
bp_register_template_stack( 'md_bp_blade_register_template_location', 1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @shanebp
Thanks for your recommandations, you're right.
I've made it working by putting my snippet in bp-custom.php like this:
But this technique doesn't work with bp ajax for example when bp groups loop is reloaded with ajax
I'm sure there is something to do with bp_locate_template() or bp_locate_template_and_load()
to inject correctly my buddypress templates in the_content from mytheme/resources/views/buddypress (instead of mytheme/resources/buddypress/)
By the way i'm using the Sage starter theme https://roots.io/sage/