2009-10-12 52 views

回答

9

使用get_posts会做你需要什么,documentation here

东西沿着以下

<?php 
    $postsincat = get_posts(array("cat" => 1, "showposts" => 1)); 
    $idoflatestpostincategory = $postsincat[0]->ID; 
?> 

您也可以使用线category_name而不是数组cat以使用名称而不是ID。

相关问题