Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Restrict Pages to Unregistered Members

  • Avatar of mhannor
    mhannor
    Participant

    @mhannor

    Someone please, can you please help me with a plugin or anything that will restrict pages unless the users login. Please help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of bp-help
    bp-help
    Participant

    @bphelp

    For buddypress specific pages see this thread:

    http://buddypress.org/support/topic/private-community-with-public-wordpress/

    For post and pages you could try this plugin:

    http://wordpress.org/extend/plugins/wp-members/

    Avatar of mhannor
    mhannor
    Participant

    @mhannor

    So I placed this in wp-content\plugins\bp-custom.php

    Then I added:

    function bp_guest_redirect() {

    global $bp;

    if ( bp_is_activity_component() || bp_is_groups_component() /*||

    bbp_is_single_forum()*/ ||bp_is_forums_component() ||

    bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) ) {

    // enter the slug or component conditional here

    if(!is_user_logged_in()) { // not logged in user

    wp_redirect( get_option(‘siteurl’) . ‘/members-2′ );

    } // user will be redirect to any link to want

    }

    }

    add_filter(‘get_header’,’bp_guest_redirect’,1);

     

    That didnt help the pages still show

    Avatar of mhannor
    mhannor
    Participant

    @mhannor

    I finally figured it out, for some odd reason, it would not work with <?  ?> tags I had to do <?php ?>, wierd, but I dont care lol it worked, thanks a million.

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

You must be logged in to reply to this topic.