|
发表于 2014-12-27 12:07:19
|
显示全部楼层
把这个放在functions.php
[mw_shl_code=php,false]
function login_need() {
//global $user_ID;
$user_ID = get_current_user_id();
if ($user_ID == '' && $_SERVER['PHP_SELF'] != "/wp-login.php" && $_SERVER['PHP_SELF'] != "/wp-signup.php")
{
header('Location: /wp-login.php');
exit;
}
}
add_action( 'init', 'login_need' );[/mw_shl_code]
|
|