archive.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * The template for displaying archive pages
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Seventeen
  9. * @since 1.0
  10. * @version 1.0
  11. */
  12. get_header(); ?>
  13. <div class="wrap">
  14. <?php if ( have_posts() ) : ?>
  15. <header class="page-header">
  16. <?php
  17. the_archive_title( '<h1 class="page-title">', '</h1>' );
  18. the_archive_description( '<div class="taxonomy-description">', '</div>' );
  19. ?>
  20. </header><!-- .page-header -->
  21. <?php endif; ?>
  22. <div id="primary" class="content-area">
  23. <main id="main" class="site-main" role="main">
  24. <?php
  25. if ( have_posts() ) : ?>
  26. <?php
  27. /* Start the Loop */
  28. while ( have_posts() ) : the_post();
  29. /*
  30. * Include the Post-Format-specific template for the content.
  31. * If you want to override this in a child theme, then include a file
  32. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  33. */
  34. get_template_part( 'template-parts/post/content', get_post_format() );
  35. endwhile;
  36. the_posts_pagination( array(
  37. 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
  38. 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
  39. 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
  40. ) );
  41. else :
  42. get_template_part( 'template-parts/post/content', 'none' );
  43. endif; ?>
  44. </main><!-- #main -->
  45. </div><!-- #primary -->
  46. <?php get_sidebar(); ?>
  47. </div><!-- .wrap -->
  48. <?php get_footer();