Do you use the login system that comes with our plugin? Then, the plugin should redirect you to the same page from where you’re logging in to the site. You’re redirected to the “account page” only when you login directly from the form page dedicated for login.
Kindly try adding the following code in your theme’s functions.php and this should redirect you to the listing form page when you login directly through the login page.
function acadp_custom_redirect_after_login( $redirect_to, $requested_redirect_to, $user ) {
if( ! isset( $user->ID ) ) {
return $redirect_to;
}
// Use the redirect_to parameter if one is set, otherwise redirect to their account page.
if( '' == $requested_redirect_to ) {
$page_settings = get_option( 'acadp_page_settings' );
$redirect_url = get_permalink( $page_settings['listing_form'] );
} else {
$redirect_url = $redirect_to;
}
return wp_validate_redirect( $redirect_url, home_url() );
}
add_filter( 'login_redirect', 'acadp_custom_redirect_after_login', 99, 3 );
Hello!
Thank you for the quick reply! This worked! Thank you so much!
Yes i do use your login system. Just out of curiosity how do you login without using the login form?
Best regards,
Michael