How-to and Troubleshooting
2
Posts
2
Users
0
Reactions
1,036
Views
Jul 17, 2019 5:54 pm
I've been searching for information about how to lead users directly to my forum after login. (because mine goes to wordpress dashboard). I found avoid using wp-login.php should fix the problem. However, I don't know how to get rid of wp-login.php? Is there step by step tutorial? or explanations?
1 Reply
Jul 17, 2019 6:12 pm
You can actually redirect users from WP Login->Dashboard to Home page. Maybe to the forum URL (i haven't tried that).
Put this to your theme's function.php
/* redirect users to front page after login Start */
function redirect_to_front_page() {
global $redirect_to;
if (!isset($_GET['redirect_to'])) {
$redirect_to = get_option('siteurl');
}
}
add_action('login_form', 'redirect_to_front_page');
/* redirect users to front page after login end */