-
Author
-
February 16, 2019 at 20:04 #218724bozlooParticipant
I put the following code under Kleo-child/function.php but, it does not work.
function my_login_redirect( $redirect_to, $request, $user )
{
if (isset($user->roles) && is_array($user->roles))
{
//if (in_array(‘subscriber’, $user->roles))
{
$redirect_to = home_url( ‘/register/’ );
}
}
return $redirect_to;
}
February 16, 2019 at 20:05 #218725bozlooParticipantlook like the login did not active login_redirect
February 16, 2019 at 20:12 #218726Kieran_SQModeratorHi,
What is it you would like to achieve? Are you trying to redirect a user once they login to a specific page? If so, please try Peter’s Login Redirect which can be found in the WordPress.org plugin repository under WP Admin > Plugins > Add New.
See here for detailed setup instructions https://archived.seventhqueen.com/general/article/redirect-users-when-logging-in-or-logging-out.
If this is not what you meant please provide more details so I can assist you better.
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
February 16, 2019 at 21:15 #218727bozlooParticipantyes, that’s right and i used Peter’s Login Redirect but, it does not work.
February 16, 2019 at 21:18 #218728Kieran_SQModeratorHi,
The plugin does work, maybe it wasn’t configured correctly, can you send me login details in a private reply along with the type of redirect you would like to achieve and I’ll set this up for you.
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
February 16, 2019 at 21:18 #218729bozlooParticipantAnd kleo has a code to do this. .. wp-content/themes/kleo/lib/options.php
Where can i find the option in admin page?
array(
‘id’ => ‘login_redirect_custom’,
‘type’ => ‘text’,
‘title’ => __( ‘Custom link redirect’, ‘kleo_framework’ ),
‘description’ => __( ‘Set a link like http://yoursite.com/homepage for users to get redirected on login.<br>’ .
‘ For more complex redirect logic please set Login redirect to Default WordPress and use Peter\’s redirect plugin or a similar plugin.’, ‘kleo_framework’ ),
‘default’ => ”,
‘required’ => array( ‘login_redirect’, ‘=’, ‘custom’ ),
),February 16, 2019 at 21:21 #218730Kieran_SQModeratorHi,
You can set the basic login redirect in KLEO via WP Admin > Theme Options > Miscellaneous and select your desired option for redirect (see screenshot).
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
Attachments:
You must be logged in to view attached files.February 16, 2019 at 21:23 #218733bozlooParticipanti found that. and it works..
I dont know why peter’s redirect does now work and changing kleo-child.php does not work..
some kleo code block it.
Thanks,
iljunFebruary 16, 2019 at 21:26 #218734Kieran_SQModeratorHi iljun,
Glad this is working for you. Feel free to open a new topic if you have any other questions or experience any issues.
All the best,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
-
AuthorPosts
You must be logged in to reply to this topic.