2014-06-16 68 views
0

所以我的链接显示的旧帖子不是我的主博客页面http://surechamp.com/blog/它的显示罚款我archive.php所以我不知道为什么它不与索引工作显示工作.PHP。我使用下划线作为我的基本主题为关闭的工作。这是我的代码:分页不在主的index.php

 <?php /* Start the Loop */ ?> 
     <?php while (have_posts()) : the_post(); ?> 

      <?php 
       /* Include the Post-Format-specific template for the content. 
       * If you want to override this in a child theme, then include a file 
       * called content-___.php (where ___ is the Post Format name) and that will be used instead. 
       */ 
       get_template_part('content', get_post_format()); 
      ?> 

     <?php endwhile; ?> 

     <?php _s_paging_nav(); ?> 

    <?php else : ?> 

     <?php get_template_part('content', 'none'); ?> 


    <?php endif; ?> 

回答

0

我通常运行环和外测分页导航是否会有所示的上一个或下一个链接:

<?php if ( $wp_query->max_num_pages > 1) : ?> 
    <?php if($wp_query->get('paged') || $wp_query->get('paged') > 1): ?> 
     <a class="loadPrev" href="<?php previous_posts(); ?>">prev</a> 
    <?php endif; ?> 

    <?php if ($next_url = next_posts($wp_query->max_num_pages, false)): ?> 
     <a class="loadNext" href="<?php echo $next_url; ?>">next</a> 
    <?php endif;?> 
<?php endif; ?> 
相关问题