front-page.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * The front page template file.
  4. *
  5. * If the user has selected a static page for their homepage, this is what will
  6. * appear.
  7. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  8. *
  9. * @package Pique
  10. */
  11. get_header(); ?>
  12. <div id="primary" class="content-area">
  13. <main id="main" class="site-main" role="main">
  14. <?php // Show the selected frontpage content
  15. if ( have_posts() ) :
  16. while ( have_posts() ) : the_post();
  17. get_template_part( 'components/content', 'hero' );
  18. endwhile;
  19. else : // I'm not sure it's possible to have no posts when this page is shown, but WTH
  20. get_template_part( 'components/content', 'none' );
  21. endif;
  22. ?>
  23. <?php
  24. // Get each of our panels and show the post data
  25. $panels = array( '1', '2', '3', '4', '5', '6', '7', '8' );
  26. foreach ( $panels as $panel ) :
  27. if ( get_theme_mod( 'pique_panel' . $panel ) ) :
  28. $post = get_post( get_theme_mod( 'pique_panel' . $panel ) );
  29. setup_postdata( $post );
  30. set_query_var( 'pique_panel', $panel );
  31. get_template_part( 'components/content', 'front' );
  32. wp_reset_postdata();
  33. endif;
  34. endforeach;
  35. ?>
  36. </main><!-- #main -->
  37. </div><!-- #primary -->
  38. <?php get_footer(); ?>