archive.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. <?php while ( have_posts() ) : the_post();?>
  12. <div class="col-sm-6">
  13. <div class="archive-thumbnail">
  14. <?php if ( has_post_thumbnail() ) : ?>
  15. <?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'medium'); ?>
  16. <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>
  17. <?php else: ?>
  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 get_template_directory_uri(); ?>/img/no-image.png" width="100%" alt="<?php the_title(); ?>"/></a>
  19. <?php endif; ?>
  20. </div>
  21. <article class="archive-card">
  22. <div class="entry-content">
  23. <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>
  24. <?php dw_good_excerpt(210); ?>
  25. </div>
  26. </article>
  27. </div>
  28. <?php endwhile;
  29. dw_paging_nav();
  30. else :
  31. printf( __( 'Nothing Found', 'dw' ));
  32. get_search_form();
  33. endif;
  34. ?>
  35. </div>
  36. <div class="clear">&nbsp;</div>
  37. <div class="row">
  38. <div id="nav-below" class="navigation">
  39. <?php
  40. $archive_year = get_the_date('U');
  41. $old_archive = date("Y",strtotime('-1 year', $archive_year));
  42. $new_archive = date("Y",strtotime('+1 year', $archive_year));
  43. ?>
  44. <div class="nav-previous">
  45. &larr; <a href="<?php echo get_year_link( $old_archive ); ?>"><?php echo $old_archive ?></a>
  46. </div>
  47. <div class="nav-next">
  48. <a href="<?php echo get_year_link( $new_archive ); ?>"><?php echo $new_archive ?></a> &rarr;
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <?php get_footer('studio'); ?>