• Resolved Rachel Goldstein

    (@rachelgoldstein71)


    I have a custom post type called Testimonials. I am using this code to display the testimonials – there are over 70 of them:

    <?php
    if ( is_page( 2628 ) ) { ?>
    <div class="testimonial-page">
    <?php 
    
    //Define your custom post type name in the arguments
    
    $args = array('post_type' => 'testimonials');
    
    //Define the loop based on arguments
    
    $loop = new WP_Query( $args );
    
    //Display the contents
    
    while ( $loop->have_posts() ) : $loop->the_post();
    ?>
    
    <div class="headshot-row"><img src="<?php the_field('headshot'); ?>"><blockquote><?php the_field('excerpt'); ?></blockquote></div>
    <div style="clear:both;"></div>
    <?php the_field('testimonial_content'); ?>
    <p><span class="name">&mdash;<?php the_field('name'); ?><?php if (get_field('business_and_website') && get_field('business_and_website') != "") { echo ","; } ?></span> <span class="biz"><?php the_field('business_and_website'); ?></span>
    <hr>
    
    <?php endwhile;?>
    </div>
    
    <?php } ?>

    Only 10 are being displayed, and I need to add numbered pagination, like the pagination on the blog page. How can I add it here? Thanks so much.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Add numbered pagination to custom post type’ is closed to new replies.