Navigation page links
-
Hi there,
I have a custom page template called blog.php – all I want this page to do is display 10 posts per page, but I want it to include Previous and Next Entries links at the bottom of the page.
I’ve tried a range of things from the Codex but haven’t been able to get it to work. I’m hoping someone can point me in the right direction.
Here is the code from the page:
<?php /* Template Name: Blog */ get_header(); ?> <div id="columns"> <div id="centercol"> <div class="box"> <div class="top"></div> <div class="spacer"> <div id="content" class="narrowcolumn"> <?php // Page ID 21 will get category ID 12 posts, page 16 will get category 32 posts, page 28 will get category 17 posts if (is_page('21') ) { $cat = array(12); } elseif ( is_page('16') ) { $cat = array(32); } elseif ( is_page('28') ) { $cat = array(17); } else { $cat = ''; } $category = 'Blog'; // Category 1 = Blog $settings=array('category__in' => $cat,'category_name' => $category); $query = new WP_Query($settings); ?> <?php if( $query->have_posts() ) : ?> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php global $wp_query; $wp_query->in_the_loop = true; ?> <div id="post-<?php the_ID(); ?>" class="post"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to',woothemes); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="entry"> <?php the_content(); ?> </div> </div> <!--/post--> <?php endwhile; else : ?> <div class="post box"> <div class="entry-head"><h2><?php _e('404 - Not Found',woothemes); ?></h2></div> <div class="entry-content"><p><?php _e('The page you are looking for is not here.',woothemes); ?></p></div> </div> </div> <?php endif; ?> </div> <div class="fix"></div> </div> <!--/spacer --> <div class="bot"></div> </div> <!--/box --> </div> <!--/centercol --> <?php get_sidebar(); ?> <br class="fix" /> </div> <!--/columns --> <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Navigation page links’ is closed to new replies.