archive-news.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. /**
  3. * The template for displaying news archive page
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package UIU_CSE
  8. */
  9. get_header();
  10. ?>
  11. <main id="primary" class="site-main">
  12. <div class="sections">
  13. <section id="all-news" class="container">
  14. <h2>All News</h2>
  15. <hr>
  16. <?php if (have_posts()) : ?>
  17. <?php while (have_posts()) : the_post(); ?>
  18. <div class="grid">
  19. <div class="stub">
  20. <div class="stub-img-holder">
  21. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
  22. </div>
  23. <span class="news-date">January 1, 2023</span>
  24. <a href="#">
  25. <h3>Learning to make a museum more accessible</h3>
  26. </a>
  27. </div>
  28. <div class="stub">
  29. <div class="stub-img-holder">
  30. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
  31. </div>
  32. <span class="news-date">January 1, 2023</span>
  33. <a href="#">
  34. <h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
  35. </a>
  36. </div>
  37. <div class="stub">
  38. <div class="stub-img-holder">
  39. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
  40. </div>
  41. <span class="news-date">January 5, 2023</span>
  42. <a href="#">
  43. <h3>New center at addresses the forces shaping early childhood</h3>
  44. </a>
  45. </div>
  46. </div>
  47. <div class="grid">
  48. <div class="stub">
  49. <div class="stub-img-holder">
  50. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
  51. </div>
  52. <span class="news-date">January 1, 2023</span>
  53. <a href="#">
  54. <h3>Learning to make a museum more accessible</h3>
  55. </a>
  56. </div>
  57. <div class="stub">
  58. <div class="stub-img-holder">
  59. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
  60. </div>
  61. <span class="news-date">January 1, 2023</span>
  62. <a href="#">
  63. <h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
  64. </a>
  65. </div>
  66. <div class="stub">
  67. <div class="stub-img-holder">
  68. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
  69. </div>
  70. <span class="news-date">January 5, 2023</span>
  71. <a href="#">
  72. <h3>New center at addresses the forces shaping early childhood</h3>
  73. </a>
  74. </div>
  75. </div>
  76. <?php endwhile; ?>
  77. <?php the_posts_navigation(); ?>
  78. <?php
  79. else :
  80. get_template_part('template-parts/content', 'none');
  81. endif;
  82. ?>
  83. </section>
  84. </div>
  85. </main><!-- #main -->
  86. <style>
  87. header {
  88. height: 100px !important;
  89. }
  90. #all-news {
  91. display: flex;
  92. flex-direction: column;
  93. }
  94. #all-news h2 {
  95. color: #000 !important;
  96. margin-top: 40px;
  97. margin-bottom: 20px;
  98. }
  99. #all-news .stub {
  100. margin: 30px auto;
  101. }
  102. #all-news .stub-img-holder {
  103. height: 200px;
  104. overflow: hidden;
  105. }
  106. #all-news .stub-img-holder img {
  107. height: 100%;
  108. width: 100%;
  109. -o-object-fit: cover;
  110. object-fit: cover;
  111. -o-object-position: center;
  112. object-position: center;
  113. }
  114. #all-news .news-date {
  115. display: block;
  116. color: #485680;
  117. font-weight: 800;
  118. font-size: 14px;
  119. margin: 10px 0px !important;
  120. }
  121. #all-news h3 {
  122. height: 50px;
  123. font-size: 18px;
  124. line-height: 22px;
  125. font-family: "Open Sans", sans-serif;
  126. color: #2F4858 !important;
  127. margin: 20px auto;
  128. }
  129. /*# sourceMappingURL=archive-news.css.map */
  130. </style>
  131. <?php
  132. get_footer();