- This topic has 3 replies, 2 voices, and was last updated 5 years, 4 months ago by .
The topic ‘Remove Activity tab for user not members’ is closed to new replies.
Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST
Be sure we're doing our best to manage your topic as soon as possible.
Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Popular Features › Member Profile › Remove Activity tab for user not members
Hi @antonellogulino,
You can redirect any click on the activity tab by simply add the following code snippet to your website:
/**
* Change BuddyPress default Members landing tab to prevent visitor from being redirected when they visit the user profile.
*/
define('BP_DEFAULT_COMPONENT', 'profile' );
/**
* Redirect unregistered users to registration form if they visit user profile activity page.
*/
function gwangi_custom_template_redirect()
{
if( ! is_user_logged_in() && function_exists( 'bp_is_user_activity' ) && bp_is_user_activity() ) {
wp_redirect( home_url( '/register/' ) );
exit();
}
}
add_action( 'template_redirect', 'gwangi_custom_template_redirect', 1000 );
Please note that you might need to edit the /register
and change it to your registration page URL. Please also note that it seems nicer to redirect clicks to your registration page instead of hiding the tab completely as it might encourage potential users to register. However, if you wish to hide it also, we could give you the CSS snippet to do so.
To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
Regards,
You’re welcome. ?
Best regards,
The topic ‘Remove Activity tab for user not members’ is closed to new replies.
You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.
Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️
Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.
To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.
Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.