Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • testla01
    Participant

    @testla01

    hi,

    yes i tried these two versions i found:

    function bp_guest_redirect( $name ) {
    
        if( ! is_user_logged_in() ) {
    
            if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_directory() || bp_is_user() || bp_is_members_component() ) 
                wp_redirect( get_option('siteurl') . '/wp-login.php/' );
    
        }
    
    }
    add_action( 'get_header', 'bp_guest_redirect', 1, 1 );
    <?php
    function restrict_bp_pages() {
    	
    	global $bp;
    	
    	if( bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page() ) {
    		return;
    	}
    	
    	if( !is_user_logged_in() ) {
    		bp_core_redirect( $bp->root_domain .'/YOUR-LOGIN-SLUG' );
    	}	
    	
    }
    add_action( 'get_header', 'restrict_bp_pages' );

    Always i am getting a problem with my pluggable.php??


    testla01
    Participant

    @testla01

    Hallo,

    when i try your snipped @caniwigirl with the Theme Accelerate Pro i got following error-message:

    “Warning: Cannot modify header information – headers already sent by (output started at /www/**/wp-content/themes/accelerate-pro/page.php:11) in /www/htdocs/**/wp-includes/pluggable.php on line 1196”

    Do you know what’s wrong?

    thank you

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar