Вариант ” 1
Достаточно вставить в wp-login.php такие строки:
add_filter(‘login_redirect’,’redirect_to_home’);
function redirect_to_home($url) { return get_option(‘home’); }
Вот кусок wp-login со вставленым кодом
<?php
/**
* WordPress User Page
*
* Handles authentication, registering, resetting passwords, forgot password,
* and other user handling.
*
* @package WordPress
*/
/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname(__FILE__) . ‘/wp-load.php’ );
add_filter(‘login_redirect’,’redirect_to_home’);
function redirect_to_home($url) { return get_option(‘home’); }
// Redirect to https login if forced to use SSL
if ( force_ssl_admin() && !is_ssl() ) {
if ( 0 === strpos($_SERVER['REQUEST_URI'], ‘http’) ) {
wp_redirect(preg_replace(‘|^http://|’, ‘https://’, $_SERVER['REQUEST_URI']));
exit();
} else {
wp_redirect(‘https://’ . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit();
}
}
Вариант № 2
Или добавить фрагмент в functions.php
активной темы:
function redirect_to_home($url) { return get_option('home'); }
add_filter('login_redirect', 'redirect_to_home');