Display latest post in two categories with individual next/previous
-
This is the index.php of a website I am working on.
Basically what I need is to have two separate loops showing only the latest post in two separate categories (5 and 1), but when the viewer clicks on previous in one category, the other category still displays the same post it did to begin with.
So far I haven’t been able to figure out how to do this with showing just one post per category.
Would anyone be able to help me? Many thanks in advance!
<?php get_header(); ?> <div id="container"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div id="reading-plan"> <?php if ( in_category('5') ) { ?> <?php the_content('Continue reading »'); ?> <?php } ;?> </div> <div id="content" role="main"> <div id="contentInner"> <div id="post"> <?php if ( in_category('1') ) { ?> <div class="entry-content"> <?php the_content'Read more...'); ?> </div><!-- .entry-content --> <?php } ;?> </div><!-- #post-## --> </div><!-- #contentInner-## --> </div><!-- #content --> <?php endwhile; else: ?> <?php endif; ?> </div><!-- #container --> <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Display latest post in two categories with individual next/previous’ is closed to new replies.