使用分页器制作分类列表 <?php $args = array ( 'showposts' => '2', 'category_name' => 'case', 'paged' => $paged ); $the_query = new WP_Query( $args ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <div class="tile"> <div class="text"> <div style="margin-top: 400px;"> <?php if ( has_post_thumbnail() ) { ?> <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a> <?php } else {?> <img width="400" height="400" src="<?php bloginfo('template_url'); ?>/images/banner1.jpg" /> <?php } ?> <h1 style="padding: 20px 0px 20px 15px;"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> <p>项目:<?php echo get_field( 'tuibianxiangmu' ); ?></p> <p>医生:<?php echo get_field( 'zhuzhiyisheng' ); ?></p> <p>手术时间:<?php echo get_field( 'shoushushijian' ); ?></p> </div> <a href="<?php the_permalink() ?>"> <h2 class="animate-text">查看详细</h2></a> </div> </div> </div> <?php endforeach; ?> <?php endif; ?>