testimonial-page.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Template Name: Testimonial Template
  4. *
  5. * The template for displaying Testimonials.
  6. *
  7. * @package Lodestar
  8. */
  9. get_header(); ?>
  10. <div class="wrap">
  11. <div id="primary" class="content-area">
  12. <main id="main" class="site-main" role="main">
  13. <?php if ( have_posts() ) :
  14. while ( have_posts() ) : the_post(); ?>
  15. <?php get_template_part( 'components/page/content', 'page' ); ?>
  16. <?php
  17. $testimonial_query = new WP_Query( array(
  18. 'post_type' => 'jetpack-testimonial',
  19. 'order' => 'ASC',
  20. 'orderby' => 'order',
  21. 'posts_per_page' => 24,
  22. 'no_found_rows' => true,
  23. ) );
  24. ?>
  25. <?php if ( $testimonial_query->have_posts() ) : ?>
  26. <div class="testimonials">
  27. <?php
  28. while ( $testimonial_query -> have_posts() ) : $testimonial_query -> the_post();
  29. get_template_part( 'components/features/testimonials/content', 'testimonials' );
  30. endwhile;
  31. ?>
  32. </div><!-- .testimonials -->
  33. <?php
  34. endif;
  35. wp_reset_postdata();
  36. ?>
  37. <?php
  38. // If comments are open or we have at least one comment, load up the comment template.
  39. if ( comments_open() || get_comments_number() ) :
  40. comments_template();
  41. endif;
  42. ?>
  43. <?php endwhile; // End of the loop. ?>
  44. <?php else : ?>
  45. <?php get_template_part( 'template-parts/content', 'none' ); ?>
  46. <?php endif; ?>
  47. </main><!-- #main -->
  48. </div><!-- #primary -->
  49. <?php get_sidebar(); ?>
  50. </div><!-- .wrap -->
  51. <?php
  52. get_footer();