2010-09-09 48 views

回答

3

在网上搜索了一下,但没有结果。然后我打开文件wp-include/link-tempalte.php。

On line 1327 you will find next_post_link which called adjacent_post_link function。 该函数再次调用get_adjacent_post函数来检索先前的发布数据。

查看源,你应该能够做到以下几点:

$in_same_cat = false; 
    $excluded_categories = ''; 
    $previous = true; 
    $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous); 
    echo $post->post_date; 

这不是测试,但我认为这HOULD工作。

+0

感谢您的提示。唉,由get_adjacent_post()返回的post数组没有post_date,但它确实有post ID(尽管形式为http://example.com?p=21),所以我可以从这里将它改写。 – hitfactory 2010-09-09 11:07:22

+0

备份!有一个帖子ID和日期!它正在被CSS所消耗。 – hitfactory 2010-09-09 11:31:06

相关问题