一、查找多个分类下的文章放在一个页面显示并分类where:id in(1,2,3);
<php> $posts=sp_sql_posts_paged(‘field:post_title,post_date,object_id,term_id;order:post_date desc;where:term_id in(1,2,3)‘); </php> <foreach name="posts[‘posts‘]" item="v"> <div class="more_new_fo_l_do"> <div class="more_new_fo_l_do_l"><a title="{$v.post_title}" target="_blank" href="{:leuu(‘article/index‘,array(‘id‘=>$v[‘object_id‘],‘cid‘=>$v[‘term_id‘]))}">{$v.post_title}</a></div><div class="more_new_fo_l_do_r">{:date(‘Y-m-d‘,strtotime($v[‘post_date‘]))}</div>//切换时间格式:如2017-01-01 </div> </foreach> <div class="fenye"><ul>{$posts.page}</ul></div>//分页
时间: 2024-10-31 19:11:29