display-testimonials.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. $testimonials = new WP_Query( array(
  3. 'post_type' => 'jetpack-testimonial',
  4. 'order' => 'ASC',
  5. 'orderby' => 'menu_order',
  6. 'posts_per_page' => 5,
  7. 'no_found_rows' => true,
  8. ) );
  9. $jetpack_options = get_theme_mod( 'jetpack_testimonials' );
  10. ?>
  11. <?php if ( $testimonials->have_posts() ) : ?>
  12. <div id="front-page-testimonials" class="front-testimonials testimonials">
  13. <div class="grid-row testimonials-inner">
  14. <header class="testimonials-header">
  15. <h2 class="testimonials-title">
  16. <?php
  17. if ( isset( $jetpack_options['page-title'] ) && '' != $jetpack_options['page-title'] )
  18. echo esc_html( $jetpack_options['page-title'] );
  19. else
  20. esc_html_e( 'Testimonials', 'textbook' );
  21. ?>
  22. </h2>
  23. <div class="testimonials-content">
  24. <?php echo convert_chars( convert_smilies( wptexturize( wp_kses_post( $jetpack_options['page-content'] ) ) ) ); ?>
  25. </div>
  26. </header><!-- .entry-header -->
  27. <div class="testimonials-carousel flexslider">
  28. <div class="slides">
  29. <?php
  30. while ( $testimonials->have_posts() ) : $testimonials->the_post();
  31. get_template_part( 'components/features/testimonials/content', 'testimonials' );
  32. endwhile;
  33. wp_reset_postdata();
  34. ?>
  35. </div>
  36. </div>
  37. </div>
  38. </div><!-- .testimonials -->
  39. <?php endif; ?>