front-page.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @package Dara
  4. */
  5. if ( 'posts' == get_option( 'show_on_front' ) ) :
  6. get_template_part( 'index' );
  7. else :
  8. get_header(); ?>
  9. <div id="primary" class="content-area front-page-content-area">
  10. <?php while ( have_posts() ) : the_post(); ?>
  11. <?php get_template_part( 'components/page/content', 'page' ); ?>
  12. <?php // If comments are open or we have at least one comment, load up the comment template.
  13. if ( comments_open() || get_comments_number() ) :
  14. comments_template();
  15. endif; ?>
  16. <?php endwhile; ?>
  17. </div><!-- #primary -->
  18. <?php dara_featured_pages(); ?>
  19. <?php
  20. $orderby = get_theme_mod( 'dara_testimonials', false );
  21. if ( true == $orderby ) {
  22. $orderby = 'rand';
  23. }
  24. else {
  25. $orderby = 'date';
  26. }
  27. $testimonials = new WP_Query( array(
  28. 'post_type' => 'jetpack-testimonial',
  29. 'order' => 'DESC',
  30. 'orderby' => $orderby,
  31. 'posts_per_page' => 2,
  32. 'no_found_rows' => true,
  33. ) );
  34. ?>
  35. <?php if ( $testimonials->have_posts() ) : ?>
  36. <div id="front-page-testimonials" class="front-testimonials testimonials">
  37. <div class="grid-row">
  38. <?php
  39. while ( $testimonials->have_posts() ) : $testimonials->the_post();
  40. get_template_part( 'components/testimonials/content', 'testimonial' );
  41. endwhile;
  42. wp_reset_postdata();
  43. ?>
  44. </div>
  45. </div><!-- .testimonials -->
  46. <?php endif; ?>
  47. <?php get_sidebar( 'footer' ); ?>
  48. <?php get_footer();
  49. endif;