archive.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * The template for displaying archive pages.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package Pen
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="<?php echo esc_attr( pen_content_classes() ); ?>" role="main">
  12. <div class="pen_article_wrapper">
  13. <?php
  14. if ( have_posts() ) {
  15. ?>
  16. <header class="page-header">
  17. <h1 class="page-title">
  18. <?php
  19. echo get_the_archive_title(); /* phpcs:ignore */
  20. ?>
  21. </h1>
  22. <?php
  23. the_archive_description( '<div class="archive-description">', '</div>' );
  24. ?>
  25. </header><!-- .page-header -->
  26. <?php
  27. $content_list_type = pen_list_type();
  28. if ( 'masonry' === $content_list_type ) {
  29. ?>
  30. <div id="pen_masonry">
  31. <?php
  32. }
  33. /* Start the Loop */
  34. while ( have_posts() ) {
  35. the_post();
  36. /**
  37. * Include the Post-Format-specific template for the content.
  38. * If you want to override this in a child theme, then include a file
  39. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  40. */
  41. get_template_part( 'partials/content', get_post_format() );
  42. }
  43. if ( 'masonry' === $content_list_type ) {
  44. ?>
  45. </div>
  46. <?php
  47. }
  48. get_template_part( 'partials/content', 'pagination' );
  49. } else {
  50. get_template_part( 'partials/content', 'none' );
  51. }
  52. ?>
  53. </div>
  54. </main><!-- #main -->
  55. <?php
  56. if ( ! is_singular() ) {
  57. pen_html_jump_menu( 'list' );
  58. }
  59. ?>
  60. </div><!-- #primary -->
  61. <?php
  62. get_footer();