- <?php
- $loop_cate_id=array(1,2,3);
- $num=5;
- ?>
- <?php foreach($loop_cate_id as $key=>$value){ ?>
- <div class="bankuai">
- <?php $posts = query_posts($query_string . "&cat={$value}&orderby=date&showposts={$num}" ); ?>
- <div class="xl12 xs6 xm4 margin-large-bottom"><div class="item item1">
- <h3><?php single_cat_title(); ?></h3>
- <ul>
- <?php while(have_posts()) : the_post(); ?>
- <li>
- <span class="float-right"><?php the_time('Y-m-d'); ?></span>
- <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
- </li>
- <?php endwhile; ?>
- </ul>
- <p class="more"><a href="<?php echo get_category_link($value); ?>" targer="_blank"><i class="icon-plus"></i>READ MORE</a></p></div></div>
- </ul>
- </div>
- <?php }?>
效果: