Adding Pagination to a WP_Query Loop
-
I am a semi-novice and a hack, so be gentle. ??
I want to add pagination to this page like I have on my home page (scroll to bottom).
The code for this page looks like this:
<?php /* Template Name: Resources */ ?> <?php get_header(); ?> <?php $my_query = new WP_Query('category_name=Resources&showposts=50'); global $my_query; $my_query->in_the_loop = true; global $wp_query; $wp_query->in_the_loop = true; while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <!--Start Post--> <div class="post"> <div class="p-head"> <p class="p-date"><?php the_time('l, F j, Y') ?></p> <h1><?php the_title(); ?></h1> </div> <div class="p-con"> <?php the_content(); ?> </div> <?php the_tags('Resource:  ',', '); ?> </div> <?php endwhile; ?> <?php get_footer(); ?>
I have searched the forum and, for the life of me, can’t figure this out. Can someone please help me?
Thanks,
Mike
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘Adding Pagination to a WP_Query Loop’ is closed to new replies.