- This topic has 0 replies, 1 voice, and was last updated 6 years, 10 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Home › Forums › Developing Websites › HTML PHP Snippets › BBPress Forum Tips › Redirect WordPress Registration Page To BBpress Registration Page
I wanted people to be able to register for the bbpress forum but not for my WordPress blog so I needed to redirect the WordPress register page to the bbpress registration page.
So this is what I did to redirect WordPress registration page to my own custom page.
I placed the following code into my functions.php file in my child theme. This was in my WordPress dashboard, in appearance, editor, funtions.php. Please copy the contents of the file to a notepad before editing. that way if you make a mistake you can paste the code back into the funtions.php on your server.
/**
* RedirectWPRegister()
* Redirect from Default wordpress register page to custom regsiter page.
*/
function RedirectWPRegister(){
$request = basename($_SERVER['REQUEST_URI']);
if ($request == 'wp-login.php?action=register'):
wp_redirect(site_url('/registernow'));
exit();
endif;
}
add_filter('init', 'RedirectWPRegister');
I got this code from here but took out the php tags.
I also changed the wp_redirect(site_url(‘/register-forum‘)); to my page I want people to go to.
I have a Genesis framework using eleven40pro child theme and bbpress.
Now when someone tries to go to the normal register page for WordPress which is wp-login.php?action=register they will be directed to the forum login page.
the reason I did this was because I wanted to enable registration on bbpress but did not want it for my WordPress site. So I have no login links, but if they are smart enough to find it then they will be redirected to the right page.
Mitz from Tips4pc