archive_loop.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <main id="main" class="site-main" role="main">
  2. <div id="primary" class="content-area">
  3. <article id="comments-page" class="comments-page page type-page status-publish hentry entry">
  4. <header class="entry-header alignwide">
  5. <?php
  6. the_archive_title( '<h1 class="page-title">', '</h1>' );
  7. the_archive_description( '<div class="taxonomy-description">', '</div>' );
  8. ?>
  9. </header><!-- .page-header -->
  10. <?php
  11. if ( have_posts() ) : ?>
  12. <div class="entry-content">
  13. <?php /* Start the Loop */ ?>
  14. <div class="mosaic-container entry-content post">
  15. </div><!-- #mosaic-container -->
  16. </div>
  17. <?php else :
  18. get_template_part( 'template-parts/content', 'none' );
  19. endif; ?>
  20. </article>
  21. <header class="entry-header alignwide">
  22. <?php
  23. the_archive_title( '<h1 class="page-title">', '</h1>' );
  24. the_archive_description( '<div class="taxonomy-description">', '</div>' );
  25. ?>
  26. </header><!-- .page-header -->
  27. <?php while ( have_posts() ) : ?>
  28. <?php
  29. /* get_template_part( 'template-parts/content', get_post_format() ); */
  30. $post = get_post(the_post());
  31. $image = false;
  32. if ( get_attached_media('image', $post->ID) ) {
  33. $image = array_shift(get_attached_media('image', $post->ID));
  34. $image = $image->ID;
  35. }
  36. if (! $image) {
  37. $image = get_post_thumbnail_id($post->ID);
  38. echo "<!-- get_the_post_thumbnail " . $image . " -->\n";
  39. }
  40. if ( $image ) {
  41. /* $thumbsrc = wp_get_attachment_image_src($image->ID, 'optics-mws-gallery-thumb')[0]; */
  42. $thumbsrc = wp_get_attachment_image_src($image, 'thumbnail')[0];
  43. $fullsrc = wp_get_attachment_image_src($image,'full')[0];
  44. $style = "";
  45. } else {
  46. $thumbsrc = get_stylesheet_uri() . '/../270.png';
  47. $tithumbsrc = get_stylesheet_uri() . '/../560.png';
  48. $style = "style='display: inline-block !important; background: #ddd;'";
  49. }
  50. echo "<div class='box box2'><a href='$fullsrc'><img src='$thumbsrc' /></a>\n";
  51. echo "<div class='imagetitlebar' $style><a href='", get_permalink($post->ID),
  52. "'><span><b>", get_the_title($post->ID), "</b><br />(",
  53. get_the_date('', $post->ID), ")</span></a></div>";
  54. echo '</div><!-- end box -->';
  55. ?>
  56. <?php endwhile; ?>