index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. * Learn more: {@link https://codex.wordpress.org/Template_Hierarchy}
  11. *
  12. * @package WordPress
  13. * @subpackage Twenty_Fifteen
  14. * @since Twenty Fifteen 1.0
  15. */
  16. get_header(); ?>
  17. <div id="primary" class="content-area">
  18. <main id="main" class="site-main" role="main">
  19. <?php if ( have_posts() ) : ?>
  20. <?php if ( is_home() && ! is_front_page() ) : ?>
  21. <header>
  22. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  23. </header>
  24. <?php endif; ?>
  25. <?php
  26. // Start the loop.
  27. while ( have_posts() ) : the_post();
  28. /*
  29. * Include the Post-Format-specific template for the content.
  30. * If you want to override this in a child theme, then include a file
  31. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  32. */
  33. get_template_part( 'content', get_post_format() );
  34. // End the loop.
  35. endwhile;
  36. // Previous/next page navigation.
  37. the_posts_pagination( array(
  38. 'prev_text' => __( 'Previous page', 'twentyfifteen' ),
  39. 'next_text' => __( 'Next page', 'twentyfifteen' ),
  40. 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
  41. ) );
  42. // If no content, include the "No posts found" template.
  43. else :
  44. get_template_part( 'content', 'none' );
  45. endif;
  46. ?>
  47. </main><!-- .site-main -->
  48. </div><!-- .content-area -->
  49. <?php get_footer(); ?>