index.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * @package Apostrophe 2
  4. *
  5. * The main template file.
  6. *
  7. * This is the most generic template file in a WordPress theme
  8. * and one of the two required files for a theme (the other being style.css).
  9. * It is used to display a page when nothing more specific matches a query.
  10. * E.g., it puts together the home page when no home.php file exists.
  11. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  12. */
  13. get_header(); ?>
  14. <section id="primary" class="content-area">
  15. <main id="main" class="site-main" role="main">
  16. <?php if ( have_posts() ) :
  17. if ( is_home() && ! is_front_page() ) : ?>
  18. <header>
  19. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  20. </header>
  21. <?php endif; ?>
  22. <?php
  23. if ( is_home() ) {
  24. // Include the featured content template.
  25. get_template_part( 'content', 'featured' );
  26. }
  27. ?>
  28. <?php /* Start the Loop */ ?>
  29. <div id="posts-wrapper">
  30. <?php while ( have_posts() ) : the_post(); ?>
  31. <?php
  32. /* Include the Post-Format-specific template for the content.
  33. * If you want to override this in a child theme, then include a file
  34. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  35. */
  36. get_template_part( 'content', get_post_format() );
  37. ?>
  38. <?php endwhile; ?>
  39. </div><!-- #posts-wrapper -->
  40. <?php else : ?>
  41. <?php get_template_part( 'content', 'none' ); ?>
  42. <?php endif; ?>
  43. </main><!-- #main -->
  44. <?php the_posts_navigation(); ?>
  45. </section><!-- #primary -->
  46. <?php get_sidebar(); ?>
  47. <?php get_footer(); ?>