我已經創建了一個自定義的博客頁面模板,但問題是我不能插入分頁鏈接,但我想顯示分頁鏈接下一個和博客的底部以前我應該什麼做....分頁在我的自定義博客頁面模板WordPress的
這裏是我的代碼
<?php /*
Template Name: My Blog Page
*/
?>
<div class="col-md-9 col-sm-9">
<!-- Blog Post -->
<?php
$args = array('post_type' => 'post', 'posts_per_page' => 10, 'ignore_sticky_posts' => 1, 'category_name' => 'blog',);
$post_type_data = new WP_Query($args);
while ($post_type_data->have_posts()):
$post_type_data->the_post();
global $more;
$more = 0; ?>
<div class="row blog-row" style="padding: 20px 0;border- bottom: 1px solid #A9A9A9;">
<div style="width: 50%;float: left">
<div class="feature-image img-overlay">
<?php if (has_post_thumbnail()): ?>
<?php $default = array('class' => 'img-responsive');
the_post_thumbnail('wl_blog_img', $default); ?>
<?php endif; ?>
</div>
</div>
<div class="feature-content" style="padding-left: 15px;display: inline-block;width: 50%">
<h3 class="h3-blog-title">
<a href="<?php echo the_permalink(); ?>"><?php echo the_title(); ?></a>
</h3>
<span style="padding-right: 5px"><i class="icon-picture"></i></span>
<span style="padding-right: 5px"><i class="icon-time"></i><?php echo get_the_date('j'); ?> <?php echo the_time('M'); ?>, <?php echo the_time('Y'); ?></span>
<span style="padding-right: 5px"><i class="icon-user"></i><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php echo get_the_author(); ?></a></span><br><br>
<?php the_excerpt(); ?>
<a class="my-btn" href="<?php echo the_permalink(); ?>">Read More</a>
</div>
<div class="feature-details1">
</div>
</div>
<?php endwhile; ?>
<!-- //Blog Post// -->
</div>
'抵消'=> 0變化的每一頁 '抵消'=> 10,每一頁變化的分頁代碼變量 – 2014-11-06 10:18:42
$ args = array('post_type'=>'post','posts_per_page'=> 10,'ignore_sticky_posts'=> 1,'category_name'=>'blog','offset'=> 0);然後更改設置值 – 2014-11-06 10:19:14