index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * The main template file.
  4. *
  5. * This is the most generic template file in a WordPress theme
  6. * and one of the two required files for a theme (the other being style.css).
  7. * It is used to display a page when nothing more specific matches a query.
  8. * E.g., it puts together the home page when no home.php file exists.
  9. *
  10. * @link https://codex.wordpress.org/Template_Hierarchy
  11. *
  12. * @package Rebalance
  13. */
  14. get_header(); ?>
  15. <div id="primary" class="content-area">
  16. <?php
  17. /*
  18. * Include the Featured Project loop.
  19. * - if featured posts exist, collect their IDs and exclude them from the main loop
  20. */
  21. if ( rebalance_has_featured_projects( 1 ) ) {
  22. $featured_ids = rebalance_get_featured_project_ids();
  23. get_template_part( 'template-parts/section', 'featured' );
  24. } else {
  25. $featured_ids = null;
  26. } ?>
  27. <main id="main" class="site-main" role="main">
  28. <?php if ( have_posts() ) : ?>
  29. <?php if ( is_home() && ! is_front_page() ) : ?>
  30. <header>
  31. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  32. </header>
  33. <?php endif; ?>
  34. <div id="infinite-wrap">
  35. <?php /* Start the Loop */ ?>
  36. <?php while ( have_posts() ) : the_post(); ?>
  37. <?php
  38. /*
  39. * Include the Card template for the content.
  40. */
  41. get_template_part( 'template-parts/content', 'card' );
  42. ?>
  43. <?php endwhile; ?>
  44. </div>
  45. <?php the_posts_navigation(); ?>
  46. <?php else : ?>
  47. <?php get_template_part( 'template-parts/content', 'none' ); ?>
  48. <?php endif; ?>
  49. </main><!-- #main -->
  50. </div><!-- #primary -->
  51. <?php get_sidebar(); ?>
  52. <?php get_footer(); ?>