archive-news.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. <section id="archive-hero">
  13. <div class="container">
  14. <!-- breadcrumb -->
  15. <nav aria-label="breadcrumb">
  16. <ul>
  17. <li><a href="#">Home</a></li>
  18. <li><a href="#">Category</a></li>
  19. <li>News</li>
  20. </ul>
  21. </nav>
  22. <div class="content">
  23. <!-- left content -->
  24. <div class="left-content">
  25. <div class="main-title">News</div>
  26. <div class="short-details">
  27. As a graduate you will have access to all University of London alumni services.
  28. </div>
  29. <div class="links">
  30. <!-- message -->
  31. <a href="#">
  32. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  33. </a>
  34. <!-- printer -->
  35. <a href="#">
  36. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  37. </a>
  38. <!-- facebook -->
  39. <a href="#">
  40. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  41. </a>
  42. <!-- twitter -->
  43. <a href="#">
  44. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  45. </a>
  46. <!-- linkedin -->
  47. <a href="#">
  48. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  49. </a>
  50. </div>
  51. </div>
  52. <!-- right content -->
  53. <div class="right-content">
  54. <img src="<?php echo (get_template_directory_uri()) ?>/img/campus_07.jpg" alt="">
  55. </div>
  56. </div>
  57. </div>
  58. </section>
  59. <div class="sections">
  60. <section id="all-news" class="container">
  61. <h2>All News</h2>
  62. <hr>
  63. <div class="parent-grid">
  64. <?php if (have_posts()) : ?>
  65. <?php while (have_posts()) : the_post(); ?>
  66. <div class="stub grid-sub-item">
  67. <div class="stub-img-holder">
  68. <img class="stub-img" src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
  69. </div>
  70. <span class="news-date"><?php the_field('news_date'); ?></span>
  71. <a href="<?php echo get_permalink(); ?>">
  72. <h3><?php echo get_the_title(); ?></h3>
  73. </a>
  74. </div>
  75. <?php endwhile; ?>
  76. <?php the_posts_navigation(); ?>
  77. <?php
  78. else :
  79. get_template_part('template-parts/content', 'none');
  80. endif;
  81. ?>
  82. </div>
  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();