我的最终解决方案。。。
function cookie_redirect() {
// THE PAGE SLUG, YOU WANT TO BE REDIRECTED TO, WHEN THERE IS NO COOKIE
$pageslug = "about-myself";
// THE COOKIE NAME
$cookie_name = "thecookiemonster";
// CHECK IF YOUR COOKIE IS SET
if (!isset($_COOKIE[$cookie_name])) {
// SINCE THERE IS NO COOKIE, THEN SET IT
setcookie( $cookie_name, 1, time()+1209600, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
// GRABS THE CURRENT PAGE NAME - THIS IS ALSO KNOWN AS THE PAGE/POST SLUG
$pagename = get_query_var(\'pagename\');
// MAKE SURE YOU ARE NOT AT THE PAGE YOU WANT TO BE DIRECTED TO, PREVENTS LOOP
if( $pagename != $pageslug) {
// REDIRECT US
wp_redirect( get_site_url() . \'/\' . $pageslug ); exit;
} else {
}
} else {
}
}
add_action( \'init\', \'cookie_redirect\');