index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 Scratchpad
  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. $currentpost = 1;
  26. /* Start the Loop */
  27. while ( have_posts() ) : the_post();
  28. if ( ! is_sticky() ) {
  29. scratchpad_pieces( $currentpost );
  30. }
  31. $currentpost++;
  32. /*
  33. * Include the Post-Format-specific template for the content.
  34. * If you want to override this in a child theme, then include a file
  35. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  36. */
  37. get_template_part( 'template-parts/content', get_post_format() );
  38. endwhile;
  39. the_posts_navigation();
  40. else :
  41. get_template_part( 'template-parts/content', 'none' );
  42. endif; ?>
  43. </main><!-- #main -->
  44. </div><!-- #primary -->
  45. <?php
  46. get_sidebar();
  47. get_footer();