WordPress的分页似乎被忽略了

时间:2015-03-10 08:16:17

标签: php wordpress

我的'旧条目'链接无效。有人可以帮忙检查一下吗?因为我找不到它。

我的网站是http://prestasijunior.org/news/。这就是链接不起作用的地方。

以下是代码:

<?php
    //query posts
        query_posts(
            array(
            'post_type'=> 'post',
            'paged'=>$paged
        ));
    ?>

<?php query_posts("showposts=1")?>

    <?php if (have_posts()) : ?>
            <?php get_template_part( 'loop', 'entry') ?>
    <?php endif; ?>       

</div>

<?php get_sidebar(); ?>

<?php
// Show a selected number of posts per row
$posts_per_row = 2;
$posts_per_page = 8;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
   'posts_per_page' => $posts_per_page,
   'paged' => $paged,
);
query_posts($args);
query_posts('offset=1');
if (have_posts()) {
   while (have_posts()) {
      the_post();
      if ((++$post_counter % $posts_per_row) == 1  || $posts_per_row == 1) {
         if ($post_counter > 1) {
            echo "</div><!-- End of post_row -->\n";  // End previous row
         }
         echo "<div class='post_row'>\n";  // Start a new row
      }
      echo "<div class='post_class'>\n";  // Start one post
      // Output post data here
      echo "<div class='loop-entry-jmy'>\n";
      echo "<div class='loop-entry-date-j'>\n";the_time('j');echo "</div>\n";
      echo "<div class='loop-entry-date-m'>\n";the_time('M');echo "</div>\n";
      echo "<div class='loop-entry-date-y'>\n";the_time('Y');echo "</div>\n";
      echo "</div>\n";
      echo "<a href='". get_permalink() ."' id='news-title-2'>";the_title();echo "</a>";
      echo "<div class='p-excerpt'>\n";the_excerpt();echo "</div>\n";
      echo "</div><!-- End of post_class -->\n";  // End of post
   } ?>

   </div><!-- End of post_row -->
   <div class='clear'></div>
   <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
   </div>
<?php } else {
   // Code for no posts found
}
?>

非常感谢你的帮助。

0 个答案:

没有答案