2011-07-08 60 views

回答

0

使用下面的代码:

$args = array(
    'numberposts'  => 1, 
    'offset'   => 0, 
    'category'  => , 
    'orderby'   => 'post_date', 
    'order'   => 'DESC', 
    'include'   => , 
    'exclude'   => , 
    'meta_key'  => , 
    'meta_value'  => , 
    'post_type'  => 'post', 
    'post_mime_type' => , 
    'post_parent'  => , 
    'post_status'  => 'publish'); 

$posts = get_posts($args); 

你可以找到在$posts文章的标题。 通过在参数列表中更改order,您可以获取最新或最后一篇文章。

编号:http://codex.wordpress.org/Template_Tags/get_posts

相关问题