archive.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 class="col-md-12">
  41. <div id="nav-below" class="navigation">
  42. <?php $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. </div>
  58. <?php get_footer('home'); ?>