Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to hide member page from logout users?

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is a question for S2 Member then and you should check it’s extensive documentation on how to block pages, if that proves unsuitable for your purposes then check back here and people can point you in the right direction to write custom functions to make pages private.


    bp-help
    Participant

    @bphelp

    @buddies
    If after following Hugo’s advice does not resolve your issue then place the below snippet in bp-custom.php

    
    function bphelp_members_page_private_redirect() { 
    
    if ( bp_is_members_component() ) {
    
    	if(!is_user_logged_in()) { 
    		bp_core_redirect( get_option('home') . '/register' );
    	} 
    }
    }
    add_filter('template_redirect','bphelp_members_page_private_redirect',1);
    

    Good luck!


    Buppha
    Participant

    @buddies

    Thanks, I have found out that I did everything it says, but it did not work in the beginning because of my theme. After I have updated my theme to the newer version everything works fine now. So, how can I close this topic now?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to hide member page from logout users?’ is closed to new replies.
Skip to toolbar