I'm trying to display a list of testimonials on a testimonials page. The testimonials are enabled through the
TB Testimonials plugin.
I then created a page template for it with the following code:
PHP Code:
<?php
/*
Template Name: Testimonials
*/
add_action('genesis_after_loop', 'testimonials_loop');
function testimonials_loop() {
global $paged;
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$args = (array(
'post_type' => 'testimonial',
'paged' => $paged,
'posts_per_page' => 4
));
$loop = new WP_Query( $args );
?>
<div id="testimonials" class="hentry">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="testimonial">
<h2><?php the_title(); ?></h2>
<div class="entry-content">
<?php the_content(); ?>
<?php echo genesis_get_custom_field('tbtestimonial_company'); ?>
</div>
</div><!-- /#post-ID -->
<?php endwhile;?>
</div><!-- /#testimonials -->
<?php
}
genesis();
?>
Unfortunately I'm not able to get pagination working. I've double checked that my Reading Settings are only showing 4 per page. I even tried adding <?php genesis_posts_nav(); ?> after the endwhile; statement above with no luck.
Appreciate any help with this.
Here's a link to the site:
http://beta.neilsonreeves.co.uk/abou...-testimonials/