Pagination to WP_Query loop
-
I have a custom loop which includes custom taxonomies:
<?php $args = array( 'post_type' => 'videos', 'posts_per_page' => 10, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => array( 'visual-arts' ) ) ) ) ; $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div id="archive-entry"> <div id="archive-thumbnail"><a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( array(200,200) ); } else { ?> <img src="<?php echo get_bloginfo('template_url') ?>/image75px.png" /> <?php } ?> </a></div><!-- #thumbnail --> <div id="archive-title"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div><!-- #archive-title --> <div id="archive-excerpt"> <?php the_excerpt(); ?> </div><!-- #archive-excerpt --> </div><!-- #archive-entry --> <?php endwhile;?>
I want to add pagination to it. I found this: but it doesn’t quite fit with the array method.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pagination to WP_Query loop’ is closed to new replies.