これは私の設定です。Wordpress next_post_link/previous_post_linkは同じカテゴリに属していません
single.php
<?php
if (in_category('my-category')) {
include(TEMPLATEPATH.'/single-my-category.php');
}
else {
include(TEMPLATEPATH.'/single-generic.php');
}
?>
シングル私の-category.php
<?php
if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php echo the_title(); ?>
<div class="pagination">
<div class="container">
<div class="row">
<div class="next col-xs-6 col-sm-6 col-md-6 col-lg-6">
<?php next_post_link('%link', '<img src="' . get_template_directory_uri() . '/img/cs-left.png" /> PREVIOUS', true); ?>
</div>
<div class="previous col-xs-6 col-sm-6 col-md-6 col-lg-6">
<?php previous_post_link('%link', 'NEXT <img src="' . get_template_directory_uri() . '/img/cs-right.png" />', true); ?>
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
これは私が続いてきたものである - http://codex.wordpress.org/Function_Reference/next_post_link
私は私は何をかなりわからないんだけど関数のin_same_termパラメータがtrueに設定されていても、何らかの理由でここで間違っていると、previous_post_linkは別のカテゴリの投稿に私を連れて行っています。
アイデア?
ありがとうございました。
-
はそれを試してみます。 [このリンクはこちら](http://wordpress.mcdspot.com/2010/06/02/stay-in-category/)をチェックしてください。また、[この回答](http://stackoverflow.com/a/3005646/629127)役立つ可能性があります。 –
投稿は1カテゴリにのみ割り当てられます –
ループ – StreetCoder