archive.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * The template for displaying archive pages
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/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. ?>
  27. <?php
  28. /* Start the Loop */
  29. while ( have_posts() ) :
  30. the_post();
  31. /*
  32. * Include the Post-Format-specific template for the content.
  33. * If you want to override this in a child theme, then include a file
  34. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  35. */
  36. get_template_part( 'template-parts/post/content', get_post_format() );
  37. endwhile;
  38. the_posts_pagination(
  39. array(
  40. 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
  41. 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
  42. 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
  43. )
  44. );
  45. else :
  46. get_template_part( 'template-parts/post/content', 'none' );
  47. endif;
  48. ?>
  49. </main><!-- #main -->
  50. </div><!-- #primary -->
  51. <?php get_sidebar(); ?>
  52. </div><!-- .wrap -->
  53. <?php
  54. get_footer();