ECSHOP首页调用WORDPRESS最新文章并支持伪静态的方法
调用下面的函数:
function get_wordpress_post($limit=5){
$sql="select * from wp_posts as p inner join wp_term_relationships as tr
on p.ID=tr.object_id where post_status='publish' and post_type='post'
order by p.id desc limit $limit";
$rows=$GLOBALS['db']->getAll($sql);
foreach ($rows as $key=>$row){
$rows[$key]['url']='blog/' . $row['post_name'] . '.html';
}
return $rows;
}