date.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php get_header(); ?>
  2. <div class="container leader">
  3. <div class="row">
  4. <div class="col-md-12">
  5. <h1 class="cm-sans fs-2 archive-heading animate__animated animate__fadeInLeft"><?php echo get_the_archive_title(); ?></h1>
  6. </div>
  7. </div>
  8. <article id="content" class="single" role="main">
  9. <div class="entry-content archive">
  10. <?php if ( have_posts() ) : ?>
  11. <?php while ( have_posts() ) : the_post(); ?>
  12. <div class="col-sm-6">
  13. <div class="entry-meta">
  14. <div class="date">
  15. <?php the_date(); ?>
  16. </div>
  17. </div>
  18. <h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'dw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
  19. <?php the_excerpt(); ?>
  20. </div>
  21. <?php endwhile; ?>
  22. <div class="clear">&nbsp;</div>
  23. <?php dw_paging_nav();
  24. else :
  25. printf( __( 'Nothing Found', 'dw' ));
  26. get_search_form();
  27. endif;
  28. ?>
  29. </div>
  30. </article>
  31. <?php
  32. // Year-to-year navigation (restored from the old archive.php). Based on the
  33. // queried year so it works even for an empty year; the "next" link is hidden
  34. // when it would point at a future (not-yet-existing) archive.
  35. $this_year = (int) get_query_var( 'year' );
  36. if ( ! $this_year ) { $this_year = (int) current_time( 'Y' ); }
  37. $prev_year = $this_year - 1;
  38. $next_year = $this_year + 1;
  39. ?>
  40. <nav class="dw-year-nav" aria-label="Yearly archives">
  41. <a class="dw-year-prev" href="<?php echo esc_url( get_year_link( $prev_year ) ); ?>">&larr; <?php echo $prev_year; ?></a>
  42. <?php if ( $next_year <= (int) current_time( 'Y' ) ) : ?>
  43. <a class="dw-year-next" href="<?php echo esc_url( get_year_link( $next_year ) ); ?>"><?php echo $next_year; ?> &rarr;</a>
  44. <?php endif; ?>
  45. </nav>
  46. </div>
  47. <?php get_footer('full'); ?>