grid-page.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Template Name: Grid Page
  4. *
  5. * @package Dara
  6. */
  7. get_header(); ?>
  8. <?php while ( have_posts() ) : the_post(); ?>
  9. <?php get_template_part( 'components/page/content', 'hero' ); ?>
  10. <?php endwhile; ?>
  11. <?php rewind_posts(); ?>
  12. <div class="content-wrapper full-width <?php echo esc_attr( dara_additional_class() ); ?>">
  13. <div id="primary" class="content-area grid-page-content-area ">
  14. <div id="main" class="site-main" role="main">
  15. <?php while ( have_posts() ) : the_post(); ?>
  16. <?php get_template_part( 'components/page/content', 'page' ); ?>
  17. <?php endwhile; // end of the loop. ?>
  18. <?php
  19. $dara_child_pages = new WP_Query( array(
  20. 'post_type' => 'page',
  21. 'orderby' => 'menu_order',
  22. 'order' => 'ASC',
  23. 'post_parent' => $post->ID,
  24. 'posts_per_page' => 999,
  25. 'no_found_rows' => true,
  26. ) );
  27. ?>
  28. <?php if ( $dara_child_pages->have_posts() ) : ?>
  29. <div class="child-pages grid">
  30. <?php
  31. while ( $dara_child_pages->have_posts() ) : $dara_child_pages->the_post();
  32. get_template_part( 'components/post/content', 'grid' );
  33. endwhile;
  34. ?>
  35. </div><!-- .child-pages .grid -->
  36. <?php
  37. endif;
  38. wp_reset_postdata();
  39. ?>
  40. <?php
  41. // If comments are open or we have at least one comment, load up the comment template
  42. if ( comments_open() || get_comments_number() ) {
  43. comments_template();
  44. }
  45. ?>
  46. </div><!-- #content -->
  47. </div><!-- #primary -->
  48. </div><!-- .content-wrapper -->
  49. <?php get_footer(); ?>