Paginating archives next_posts_link to wp_link_pages
-
Reading the function reference it seems as though I should be able to replace
<?php next_posts_link('??') ?> <?php previous_posts_link('??') ?>
with
<?php wp_link_pages(); ?>
To get paginated archives.
I have my archives displayed in a grid layout, max of 16 with the code below, and want the site to paginate if archives are > 16, but show page numbers at the bottom, similar to << 1 2 3 4 >><?php get_header(); ?> <div id="posts"> <?php $x = 0; ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php if ( is_int( $x / 4 ) ) { ?> <div class="clear"> <?php } ?> <div class="archive-posts"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?><br /><?php the_title(); ?></a> </div> <?php if ( is_int( $x / 4 ) ) { ?> </div> <?php } $x = $x + 1; ?> <?php endwhile; ?> <!--navigation--> <div id="navlinks"> <?php next_posts_link('??') ?> <?php previous_posts_link('??') ?> </div> <span class="clear"></span> <?php else : ?> <div class="text-feedback"> Not Found<br /><br /> <?php get_search_form('title='); ?></div> <?php // include (TEMPLATEPATH . '/searchform.php'); ?> <?php endif; ?> </div> <!--archive.php end--> <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Paginating archives next_posts_link to wp_link_pages’ is closed to new replies.