以下は私が使用しているコードです。私は見つけられたすべてを試しましたが、それはまだ動作しません。私のパーマリンクの構造は/%category%/%postname%/
です。 URLが正しいと確信しています。すなわち、http://localhost:8888/wordpress/blog/page/2にアクセスしようとしています。うーん、正確に同じコードは以前私が設計した別のサイトでも動作します。ワードプレスprevious_posts_link()は404エラーにつながります
誰かが正しい方向に私を向けることができますか?おかげ
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("cat=3&showposts=2&paged=" . $paged);
$wp_query->is_archive = true; $wp_query->is_home = false;
?>
<?php if (have_posts()) : ?>
<div id="lefttop"></div>
<div id="blogpoint">
<div id="leftcol">
<?php while (have_posts()) : the_post(); ?>
<div id="leftsquidge">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2><br /><br />
<?php the_excerpt(); ?>
</div>
<div id="rightsquidge">
<?php the_tags('<p><strong>File under:</strong> ', ', ', '</p>'); ?>
<?php the_time('F jS, Y') ?> by <strong><?php the_author() ?></strong>
</div>
<div style="clear:both;"></div>
<br /><br />
<?php endwhile; ?>
<div class="navigation" style="padding:0px;margin:0px;">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php endif; ?>
<div style="clear:both;"></div>
</div>
</div>
<div id="leftbot"></div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
EDIT
は、私は自分の質問に答えています。それは私が以前に試していたもので、うまくいきませんでした。カテゴリをテンプレートとして使用するページをダッシュボード上に作成する必要があります。
next_posts_link()とprevious_posts_link()の呼び出しを入れ替えてはいけませんか? –
あなたはそうだと思ったでしょうが、いいえ – Drew