custom pagination
-
I have just recently added a page to my wordpress installation page-actor.php, where I intended to list all the actors that I have on my db and with the movie count associated with them. I have successfully done this but to my dismay I cannot paginate or set posts_per_page, Ideally I would want it paginated a letter as a time e.g. a, b, c….
<?php foreach ( get_terms( array( 'taxonomy' => 'actor', ) ) as $cat) : ?> <div class="col-md-4"> <?php $the_query = new WP_Query( array( 'post_type' => 'movies', 'tax_query' => array( array( 'taxonomy' => 'actor', 'field' => 'term_id', 'terms' => $cat->term_id, ) ) ) ); $count = $the_query->found_posts; ?> <?php echo $cat->name; ?> <span style="color: white"><?php echo $count; ?></span> </div> <?php endforeach; ?>
Any help greatly appreciated.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘custom pagination’ is closed to new replies.