- This topic has 1 reply, 2 voices, and was last updated 2 years, 6 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Welcome › mkmcst community Forum › Web programming › WordPress › buddypress › BuddyPress: How to Redirect Upon Logout
Tagged: buddypress, wordpress
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.
desperate code use this instead
add_action('wp_logout','go_home');
function go_home(){
wp_redirect( home_url() );
exit();
}