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
- This topic has 3 replies, 2 voices, and was last updated 6 years, 11 months ago by
Themosaurus.
-
AuthorPosts
-
@themosaurus
- 1 Topics
- 1675 Posts
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
/registerand 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,
November 15, 2018 at 18:53 #3556@themosaurus- 1 Topics
- 1675 Posts
You’re welcome. ?
Best regards,
November 17, 2018 at 11:56 #3608 -
AuthorPosts
The topic ‘Remove Activity tab for user not members’ is closed to new replies.


