archive.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php get_header(); ?>
  2. <?php get_template_part( 'underscore' ); ?>
  3. <div class="container">
  4. <div id="content" role="main">
  5. <div class="entry-content archive-page">
  6. <div class="row">
  7. <?php if ( have_posts() ) : ?>
  8. <header class="page-header">
  9. <h1 class="super cm-sans wow fadeInRight"><?php the_time('Y'); ?></h1>
  10. </header>
  11. </div>
  12. <div class="row">
  13. <?php while ( have_posts() ) : the_post();?>
  14. <div class="col-sm-6">
  15. <div class="archive-thumbnail">
  16. <?php if ( has_post_thumbnail() ) : ?>
  17. <?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'medium'); ?>
  18. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><img class="archive-thumb" src="<?php echo $img_url[0];?>" width="100%" alt="<?php the_title(); ?>"/></a>
  19. <?php else: ?>
  20. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><img class="archive-thumb" src="<?php echo get_template_directory_uri(); ?>/img/no-image.png" width="100%" alt="<?php the_title(); ?>"/></a>
  21. <?php endif; ?>
  22. </div>
  23. <article class="archive-card">
  24. <div class="entry-content">
  25. <h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
  26. <?php dw_good_excerpt(210); ?>
  27. </div>
  28. </article>
  29. </div>
  30. <?php endwhile;
  31. dw_paging_nav();
  32. else :
  33. printf( __( 'Nothing Found', 'dw' ));
  34. get_search_form();
  35. endif;
  36. ?>
  37. </div>
  38. <div class="clear">&nbsp;</div>
  39. <div class="row">
  40. <div id="nav-below" class="navigation">
  41. <?php
  42. $archive_year = get_the_date('U');
  43. $old_archive = date("Y",strtotime('-1 year', $archive_year));
  44. $new_archive = date("Y",strtotime('+1 year', $archive_year));
  45. ?>
  46. <div class="nav-previous">
  47. &larr; <a href="<?php echo get_year_link( $old_archive ); ?>"><?php echo $old_archive ?></a>
  48. </div>
  49. <div class="nav-next">
  50. <a href="<?php echo get_year_link( $new_archive ); ?>"><?php echo $new_archive ?></a> &rarr;
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <?php get_footer('home'); ?>