BP_init not working for themes Functions.php
-
I’ve got a custom theme going, and I’d like to only add the CSS/JS/Ajax.php file’s required to run buddypress to load with the following perameters:
1. Is buddypress activated? Yes? Good, load global.js, buddypress.css and require ajax.php
2. Is the user on Buddypress Page X, Y, or Z? Yes? Good, load global.js, buddypress.css and require ajax.php
I’ve got this in my functions.php so far, but `bp_init` doesn’t seem to be working. When I load just normal `init` everything loads. Well, except for the Ajax.php, I get a WSOD when I try to require that. Can anyone help with `bp_init` not working?
`function bp_req() {
define(“BP_PATH”, WP_CONTENT_URL . ‘/buddypress’);
/* BuddyPress is installed and activated, finish initialization and go! */
//require_once( BP_PATH . ‘/bp-themes/bp-default/_inc/ajax.php’ );
wp_enqueue_script( ‘bp-js’, BP_PATH . ‘/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ) );
}
add_action( ‘bp_init’, ‘bp_req’ );`
- The topic ‘BP_init not working for themes Functions.php’ is closed to new replies.