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