Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

Remove Activity tab for user not members

This topic is resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino

    Hi guys,
    is it possible to remove the activity tab from the user card?
    and if so, is it possible to hide it only for unregistered users?

    Antonello

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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:

    Adding Custom PHP Without Changing Your Child Theme

    Regards,

    Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino

    Perfect!!! Thank you…forever 🙂

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    You’re welcome. ?

    Best regards,

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Remove Activity tab for user not members’ is closed to new replies.

Troubleshooting Demo Imports

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.

Happy With our Support So Far?

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 ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

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.

Holiday, Weather & Festive effects
to pimp your WordPress Site