index.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 Affinity
  13. */
  14. get_header(); ?>
  15. <div id="primary" class="content-area">
  16. <main id="main" class="site-main" role="main">
  17. <?php
  18. if ( have_posts() ) :
  19. if ( is_home() && ! is_front_page() ) : ?>
  20. <header>
  21. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  22. </header>
  23. <?php
  24. endif;
  25. /* Start the Loop */
  26. while ( have_posts() ) : the_post();
  27. /*
  28. * Include the Post-Format-specific template for the content.
  29. * If you want to override this in a child theme, then include a file
  30. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  31. */
  32. get_template_part( 'components/post/content', get_post_format() );
  33. endwhile;
  34. the_posts_navigation();
  35. else :
  36. get_template_part( 'components/content', 'none' );
  37. endif; ?>
  38. </main>
  39. </div>
  40. <?php
  41. get_sidebar();
  42. get_footer();