This topic has 1 reply, 2 voices, and was last updated 10 years by Kamal.

  • Author
  • #35290
     govind
    Participant

    HI,

    When I click Logout in Front taking me to Admin page Login screen. I want to reload the current page instead of landing the customer to admin page.

    Attachments:
    You must be logged in to view attached files.
    #35320
     Kamal
    Moderator

    Hello @govind,
    You can redirect your user to the home page after they log out using the following lines of code.
    Please follow the steps below to do that.
    1. you need to edit the functions.php file of KLEO Child Theme which can be found >Dashboard>Appearance>Editor>functions.php.
    2. Open functions.php of KLEO Child Theme and the following code

    COPY CODE
    
    add_action('wp_logout','redirectToHome');
    function redirectToHome(){
      wp_redirect( home_url() );
      exit();
    }
    

    to that file and save it. Now go to your site and refresh the site and test it logging out. It should redirect to the home page after log out. Please let me know if this works for you.
    Thanks,
    Kamal

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?