我目前正在使用 wordpress 3.6。
从 3.3 开始,excluded_categories 参数在 previous_post_link() 中已弃用,请参阅http://codex.wordpress.org/Function_Reference/previous_post_link#Resources。
现在明确包含或排除类别的推荐方法是什么?
我目前正在使用 wordpress 3.6。
从 3.3 开始,excluded_categories 参数在 previous_post_link() 中已弃用,请参阅http://codex.wordpress.org/Function_Reference/previous_post_link#Resources。
现在明确包含或排除类别的推荐方法是什么?
采用get_adjacent_post
$in_same_cat = false;/true
$excluded_categories = '';//cat
$previous = true;//false
$previous_post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
$in_same_cat = false;//true
$excluded_categories = '';//cat
$previous = false;//true
$next_post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);