个人
笔记网站
个人网站
wordpress 分页
<?php $order_posts = new WP_Query(array(‘post_type’ => ‘post’, ‘post_status’ => ‘publish’,’orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ));if(have_posts()):while(have_posts()):the_post();?>

 

<?php if(have_posts()):
while(have_posts()):
the_post();?>
<div class=”col-md-4″>
<div class=”work-grid”>
<a  href=”<?php the_permalink(); ?>” >
<img src=”<?php echo get_the_post_thumbnail_url(); ?>” class=”img-responsive ” alt=”<?php the_title(); ?>”/></a>
<div class=”rotate1″>
<a  href=”<?php the_permalink(); ?>” > <?php the_title(); ?></a>
</div>
<div class=”rotate2″>
<?php $the_post_category = get_the_category(get_the_ID()); echo $the_post_category[0]->cat_name; ?>
</div>
</div>
</div>
<?php endwhile; ?>

<?php endif; ?>

<div class=’col-sm-12 text-center’>
<?php $arr = array( ‘mid_size’ => 1, //当前页码数的 两边 显示几个页码。
‘prev_text’ =>’上一页’, //上一页
‘next_text’ =>’下一页’, //下一南
);
the_posts_pagination($arr);
?>
</div>
<style>
.navigation .screen-reader-text{
display: none;
}
.nav-links{
margin: 0 auto;
}
.fenye{
padding-top: 30px;
}
.nav-links a,.nav-links span{
display: inline-block;
min-height: 35px;
min-width: 37px;
padding: 0 10px;
line-height: 35px;
background-color: #fff;
font-size: 15px;
color: #070707;
text-align: center;
border:1px solid #333333;
-webkit-transition: all .3s ease-out 0s;
-o-transition: all .3s ease-out 0s;
transition: all .3s ease-out 0s
}
.nav-links span.current,.nav-links a.page-numbers:hover{
background-color: #343c5c;
color: #fff;
}
</style>