next_post_link / previous_post_link, in_same_cat=1, not working.
-
currently writing some code to display posts from a certain category but when I add the code
<?php next_post_link('%link', 'Next', true); ?>
The next post link doesn’t display, but it does display if I set the setting for “in_same_cat” to “false” but it shows the link to a post in a different category. I have 4 post in the category I am viewing so a next post does exist, the same problem happens with “previous_post_link”
I call my code within the loop in single.php this is my code below
<?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> <?php if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php twentyeleven_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; ?> </header><!-- .entry-header --> <div class="entry-content"> <div style="float:left; margin-right:6px; margin-bottom:2px; margin-top:4px;"> <?php the_post_thumbnail(array(300,999) ); ?> </div> <?php the_content(); ?> </div><!-- .entry-content --> </article><!-- #post--> <?php next_post_link('%link', 'Next', true); ?> <?php previous_post_link('%link', 'Previous', true); ?>
Any ideas community?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘next_post_link / previous_post_link, in_same_cat=1, not working.’ is closed to new replies.