Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created September 5, 2018 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/96a4719237b65a017f1cdd110ed38446 to your computer and use it in GitHub Desktop.
Save KaineLabs/96a4719237b65a017f1cdd110ed38446 to your computer and use it in GitHub Desktop.
Disable Youzer template on the profile page !
<?php
// Disable Youzer template on the profile page !
function yzc_disable_profile_template() {
if ( bp_is_user() ) {
remove_action( 'bp_init', 'yz_bp_overload_templates' );
remove_filter( 'template_include', 'yz_bbp_youzer_template', 999 );
}
}
add_action( 'bp_init', 'yzc_disable_profile_template', 9 );
@sheraz73427
Copy link

This hook is not working. I tried to add it to the functions.php of my active theme but its not working. Can you please guide me on it.
As I want to use another profile page for member profile that i have created with the help of the Buddy Builder and Elementor.
Thanks & Regards Sheraz Razzaq

@sheraz73427
Copy link

So i found the issue and here is the updated version of this to work perfectly fine.

// Disable Youzer template on the profile page !
function yzc_disable_profile_template() {
if ( bp_is_user() ) {
remove_action( 'bp_init', 'youzify_bp_overload_templates'); <== This line is changed in the core theme when i read the code
remove_filter( 'template_include', 'yz_bbp_youzer_template', 999 );
}
}

add_action( 'bp_init', 'yzc_disable_profile_template', 9 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment