This topic has 8 replies, 2 voices, and was last updated 5 years by Kieran_SQ.

  • Author
  • #218724
     bozloo
    Participant

    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;

    }

    #218725
     bozloo
    Participant

    look like the login did not active login_redirect

    #218726
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #218727
     bozloo
    Participant

    yes, that’s right and i used Peter’s Login Redirect but, it does not work.

    #218728
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #218729
     bozloo
    Participant

    And 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’ ),
    ),

    #218730
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.
    #218733
     bozloo
    Participant

    i 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,
    iljun

    #218734
     Kieran_SQ
    Moderator

    Hi 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 solution

    If 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.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?