`
yantaoliu2006
  • 浏览: 88328 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

wp函数wp_get_recent_posts

 
阅读更多

[insert_php] 

$args = array( 'category' => 1,'numberposts' => '2', );

$recent_posts = wp_get_recent_posts($args);

foreach( $recent_posts as $recent ){

echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </li> ';

}[/insert_php]

 

详细请看http://codex.wordpress.org/Function_Reference/wp_get_recent_posts

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics