How can I redirect users to the front page after log in?
/* redirect users to front page after login */
function redirect_to_front_page() {
global $redirect_to;
if (!isset($_GET['redirect_to'])) {
$redirect_to = get_option('siteurl');
}
}
add_action('login_form', 'redirect_to_front_page');
Customize WordPress Logout URL
Add filter
Add this line to your theme ‘
functions.php
‘ file or to your plugin main file.add_filter('logout_url', 'my_logout_url');
Add function
function my_logout_url( $logout_url, $redirect = null ) { return $logout_url . '&redirect_to=' . 'http://my-logout-page'; }
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。