BuddyPress: How to Redirect Upon Logout

Welcome mkmcst community Forum Web programming WordPress buddypress BuddyPress: How to Redirect Upon Logout

Viewing 1 reply thread
  • Author
    Posts
    • #754
      Michael Mc
      Keymaster
      @mkmcst

      Step 3: Go to your WordPress Dashboard and navigate to:
      Appearance > Themes > Editor
      Step 4: Select the file called “functions.php” in your child theme.
      Step 5: Copy and paste the following code under any other customizations you’ve entered:

      //* Redirect WordPress to Homepage Upon Logout
      add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));

      Step 5: Save your changes and then take it for a test drive.
      Viola! Now your users can happily redirect upon logout! This tip works for BuddyPress as well as WordPress.

    • #1611
      michael mc
      Keymaster
      @michael

      desperate code use this instead

      add_action('wp_logout','go_home');
      function go_home(){
        wp_redirect( home_url() );
        exit();
      }
Viewing 1 reply thread
  • You must be logged in to reply to this topic.