template-testimonials.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Template Name: Testimonials
  4. *
  5. * @package Pique
  6. */
  7. get_header(); ?>
  8. <div id="primary" class="content-area">
  9. <main id="main" class="site-main" role="main">
  10. <?php while ( have_posts() ) : the_post(); ?>
  11. <?php get_template_part( 'components/content', 'page' ); ?>
  12. <?php // List all testimonials in order
  13. $testimonials = new WP_Query( array(
  14. 'post_type' => 'jetpack-testimonial',
  15. 'order' => 'ASC',
  16. 'orderby' => 'order',
  17. 'posts_per_page' => 24,
  18. 'no_found_rows' => true,
  19. ) );
  20. ?>
  21. <?php if ( $testimonials->have_posts() ) : ?>
  22. <div class="pique-testimonials pique-grid-two">
  23. <?php
  24. while ( $testimonials->have_posts() ) : $testimonials->the_post();
  25. get_template_part( 'components/content', 'testimonial' );
  26. endwhile;
  27. wp_reset_postdata();
  28. ?>
  29. </div><!-- .pique-testimonials -->
  30. <?php endif; ?>
  31. <?php
  32. // If comments are open or we have at least one comment, load up the comment template.
  33. if ( comments_open() || get_comments_number() ) :
  34. comments_template();
  35. endif;
  36. ?>
  37. <?php endwhile; // End of the loop. ?>
  38. </main><!-- #main -->
  39. </div><!-- #primary -->
  40. <?php get_sidebar(); ?>
  41. <?php get_footer(); ?>