2012-11-04 228 views

回答

0

如何在購物車頁面的網址? 你是否在wordpress中設置永久鏈接?

設置>永久設置>帖子名稱

它的自動顯示/%postname%/

0

這段代碼添加到您的function.php:

add_filter('auth_cookie_expiration', 'my_expiration_filter', 99, 3); 
function my_expiration_filter($seconds, $user_id, $remember){ 
//if "remember me" is checked; 
if ($remember) { 
    //WP defaults to 2 weeks; 
    $expiration = 14*24*60*60; //UPDATE HERE; 
} else { 
    //WP defaults to 48 hrs/2 days; 
    $expiration = 2*24*60*60; //UPDATE HERE; 
} 

//http://en.wikipedia.org/wiki/Year_2038_problem 
if (PHP_INT_MAX - time() < $expiration) { 
    //Fix to a little bit earlier! 
    $expiration = PHP_INT_MAX - time() - 5; 
} 

return $expiration; 

}

+0

添加此代碼到你的function.php –

+0

請格式化你的代碼並添加評論回答 – user7294900

+0

add_filter('auth_cookie_expiration','my_expiration_filter',99,3);如果($記住){ $ expiration = 14 * 24 * 60 * 60; //在這裏更新; } else { $ expiration = 2 * 24 * 60 * 60; //在這裏更新; (PHP_INT_MAX_time()<$ expiration){expiration = PHP_INT_MAX_time() - 5;}} } return $ expiration; } –

相關問題