Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP_DTheme is not defined


  • godavid33
    Participant

    @godavid33

    WP 3.9.1 BP 2.0.1

    I am trying to deregister the javascript and then override it with custom javascript. I made a couple edits, mainly just making it so the whats-new post form doesnt animate on click. However, on certain activities (such as favoriting) I get the following javascript error: BP_DTheme is not defined

    Below is the code I am using to override the buddypress javascript.

    add_action( 'wp_print_scripts', 'de_script', 100 );
    add_action( 'wp_print_styles', 'de_style', 100 );
    
    function de_script() {
    	wp_dequeue_script( 'dtheme-ajax-js' );
    	wp_deregister_script( 'dtheme-ajax-js');
    	wp_enqueue_script( 'dtheme-ajax-js', get_bloginfo('stylesheet_directory') . '/_inc/buddypress.js', array( 'jquery' )  );
    	
    	wp_deregister_script( 'bp-legacy-js');
    	wp_dequeue_script( 'bp-legacy-js' );
    	wp_enqueue_script( 'bp-legacy-js', get_bloginfo('stylesheet_directory') . '/_inc/global.js', array( 'jquery' )  );	
    	
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)

  • godavid33
    Participant

    @godavid33

    Still a problem. Perhaps a better, clearer, more easily answered question would be “How can I override buddypress javascript?”


    godavid33
    Participant

    @godavid33

    I really hate to be that guy continually bumping his own thread, but I haven’t been able to find an answer to this on my own that doesn’t result in the same BP_DTheme is undefined error


    godavid33
    Participant

    @godavid33

    It amazes me that with such a simple solution, no one was able or willing to answer this :/

    At any rate, here is the fix. F*** functions.php, just copy buddypress.js and put it in the /js directory of your theme. Edit till your heart’s content.

    GG WP

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘BP_DTheme is not defined’ is closed to new replies.
Skip to toolbar