Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Register page as my home page


  • drmikelbrown
    Member

    @drmikelbrown

    Hello All,

    I have seen on websites bp sites where the sites home page is the register page i.e. http://www.mysite.com/register . In reading the forums this weekend I came across posts that suggested that I could accomplish this task with adding custom slugs to the wp-config.php. So I added:


    define ( ‘BP_REGISTER_SLUG’, ‘home’ );

    After clearing my cookies and viewing my site I still have the old index.php for my home page. Am I missing something? Can some one help me please. Thanks

    BTW. My site is wp 3.5.1 bp 1.3 (the one before 1.5)

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

  • David Carson
    Participant

    @davidtcarson

    There are different ways to do this.

    Do you have a bp-custom.php file in your plugins directory?
    https://codex.buddypress.org/extending-buddypress/bp-custom-php/

    If so, try adding this to it:

    `// Redirect logged out users viewing homepage to register page.
    function custom_redirect_home_to_register() {
    global $bp;

    // If user is not logged in and viewing front page
    if (!is_user_logged_in() && bp_is_front_page() ) {
    // Redirect to registration page. Change /register to your register page slug
    bp_core_redirect( get_option(‘home’) . ‘/register’ );
    }
    }

    add_action( ‘wp’, ‘custom_redirect_home_to_register’, 3 );`

    If not, create the file and include an opening php tag before adding that code. This uses basic conditionals and can be customized however you’d like.

    https://codex.buddypress.org/developer-docs/conditional-template-tags/


    drmikelbrown
    Member

    @drmikelbrown

    @David thanks this worked perfectly. I was trying a bunch of different redirects but I keep getting caught in a redirect loop. Thanks this helped a whole lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Register page as my home page’ is closed to new replies.
Skip to toolbar