index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  10. *
  11. * @package Publication
  12. */
  13. get_header(); ?>
  14. <div id="primary" class="content-area">
  15. <main id="main" class="site-main" role="main">
  16. <?php if ( have_posts() ) : ?>
  17. <?php /* Start the Loop */ ?>
  18. <?php while ( have_posts() ) : the_post(); ?>
  19. <?php
  20. if ( ! is_paged() && 0 === $wp_query->current_post && has_post_thumbnail() ) {
  21. get_template_part( 'template-parts/content', 'hero' );
  22. } else {
  23. /*
  24. * Include the Post-Format-specific template for the content.
  25. * If you want to override this in a child theme, then include a file
  26. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  27. */
  28. get_template_part( 'template-parts/content', get_post_format() );
  29. }
  30. ?>
  31. <?php endwhile; ?>
  32. <?php
  33. the_posts_navigation( array(
  34. 'prev_text' => '<span class="meta-nav">' . esc_html__( 'Older posts', 'publication' ) . '</span>',
  35. 'next_text' => '<span class="meta-nav">' . esc_html__( 'Newer posts', 'publication' ) . '</span>',
  36. ) );
  37. ?>
  38. <?php else : ?>
  39. <?php get_template_part( 'template-parts/content', 'none' ); ?>
  40. <?php endif; ?>
  41. </main><!-- #main -->
  42. </div><!-- #primary -->
  43. <?php get_sidebar(); ?>
  44. <?php get_footer(); ?>