Custom template – Display x posts per page and add paged naviation?
-
I made a custom template page (thanks to someone else here for the code) that displays only posts with category ID 20 on the page. In this case anything with the category of ‘blog’
<?php /* Template Name: Blog Posts only */ ?> <?php get_header(); ?> <div id="primary"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content(); ?> <?php endwhile; else: endif; ?> <?php query_posts('cat=20'.get_the_title().'&post_status=publish,future');?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> <?php the_content(); ?> <div class="blogartikelnext"></div> <?php endwhile; else: endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?></div>
How do I add code so it shows x (say, 3 ) posts per page, and have it add ‘older posts’ and ‘newer posts’ navigation links at the bottom?
Thanks!!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom template – Display x posts per page and add paged naviation?’ is closed to new replies.