2012-11-04 188 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; } –

相关问题