index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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://developer.wordpress.org/themes/basics/template-hierarchy/
  11. *
  12. * @package photos
  13. */
  14. get_header();
  15. ?>
  16. <div id="primary" class="content-area">
  17. <main id="main" class="site-main">
  18. <?php
  19. if ( have_posts() ) :
  20. if ( is_home() && ! is_front_page() ) :
  21. ?>
  22. <header>
  23. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  24. </header>
  25. <?php
  26. endif;
  27. /* Start the Loop */
  28. while ( have_posts() ) :
  29. the_post();
  30. get_template_part( 'template-parts/content', 'grid' );
  31. endwhile;
  32. the_posts_navigation( array(
  33. 'prev_text' => photos_get_svg( array( 'icon' => 'previous', 'title' => esc_html__( 'Older Posts', 'photos' ) ) ),
  34. 'next_text' => photos_get_svg( array( 'icon' => 'next', 'title' => esc_html__( 'Newer Posts', 'photos' ) ) ),
  35. ) );
  36. else :
  37. get_template_part( 'template-parts/content', 'none' );
  38. endif;
  39. ?>
  40. </main><!-- #main -->
  41. </div><!-- #primary -->
  42. <?php
  43. get_sidebar();
  44. get_footer();