如何用数字创建分页?

时间:2016-05-27 13:27:36

标签: php wordpress pagination

我有这个代码,我显示一个类别的帖子,但我想添加数字分页。任何建议我怎么能这样做?

 <?php $args3 = array(
            'post_status' => array('publish'),
            'orderby' => 'date',
            'order' => 'DESC',
            'cat' => 1,
            'offset' => 4,
            'posts_per_page' => 4
            );
            query_posts($args3); ?>
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="rest_of_news">
                    <?php while ( have_posts($args2) ) : the_post(); ?>
                    <div class="col-md-3 col-sm-3 col-xs-12 no-padding-left no-padding-right">
                        <div class="single_news_block">
                            <div class="news_box_image"><?php the_post_thumbnail('homeSlider'); ?>
                            </div>
                        </div>
                    <div class="program_news_block">
                        <h3><span><?php echo the_title(); ?></span></h3>
                        <h4><?php if(get_field("adresa")){ ?>
                                <span class="address"><?php echo get_field( "adresa" ); ?>, </span>
                           <?php } ?>
                           <span><?php echo get_the_time(); ?></span>
                        </h4>
                        <h6><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><img src="<?php echo get_bloginfo('template_directory');?>/images/more2_icon.png?>" class="more_icon" /></a></h6>
                    </div>
                    </div>

                      <?php endwhile; ?> 
                </div>
            </div>

0 个答案:

没有答案