wordpress添加导航页面

根据cookie 设置导航页面:

这段代码放到function

1
2
3
4
5
6
7
8
9
10
/**导航页面ByMrtcsy**/
function set_newuser_cookie() {
setcookie(DB_PREFIX.'mrtcsy', time()+3600);
if(!isset($_COOKIE[DB_PREFIX.'mrtcsy'])){
header("Location: https://secsb.com/star/index.html");
setcookie(DB_PREFIX.'mrtcsy', time()+3600);
}
}

add_action( 'init', 'set_newuser_cookie');