Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to make a private community?


Valentin Kukov
Participant

@valkukov

Please ignore my last post.

@Travel-Junkie It works a treat. Thanks very much. Just added the code below within the php tags in my active theme’s functions.php file (…/wp-content/themes/XXXXXX/functions.php) and that was all I had to do. Very nice indeed. Now the site is only visible to logged in users (except for blog posts which are visible to everyone)

function sh_walled_garden()
{
global $bp;

if( bp_is_register_page() || bp_is_activation_page() )
return;

if( ! bp_is_blog_page() && ! is_user_logged_in() )
bp_core_redirect( $bp->root_domain .’/’. BP_REGISTER_SLUG );
}
add_action( ‘get_header’, ‘sh_walled_garden’ );

Skip to toolbar