archive-news.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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>News</li>
  19. </ul>
  20. </nav>
  21. <div class="content">
  22. <!-- left content -->
  23. <div class="left-content">
  24. <div class="main-title">News</div>
  25. <div class="short-details">
  26. Here you will have access to all United International University News.
  27. </div>
  28. <div class="links">
  29. <!-- message -->
  30. <a href="#">
  31. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  32. </a>
  33. <!-- printer -->
  34. <a href="#">
  35. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  36. </a>
  37. <!-- facebook -->
  38. <a href="#">
  39. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  40. </a>
  41. <!-- twitter -->
  42. <a href="#">
  43. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  44. </a>
  45. <!-- linkedin -->
  46. <a href="#">
  47. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  48. </a>
  49. </div>
  50. </div>
  51. <!-- right content -->
  52. <div class="right-content">
  53. <img src="<?php echo (get_template_directory_uri()) ?>/img/campus_07.jpg" alt="">
  54. </div>
  55. </div>
  56. </div>
  57. </section>
  58. <div class="sections">
  59. <section id="all-news" class="container">
  60. <h2>All News</h2>
  61. <hr>
  62. <div class="parent-grid">
  63. <?php if (have_posts()) : ?>
  64. <?php while (have_posts()) : the_post(); ?>
  65. <div class="stub grid-sub-item">
  66. <div class="stub-img-holder">
  67. <img class="stub-img" src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
  68. </div>
  69. <span class="news-date"><?php the_field('news_date'); ?></span>
  70. <a href="<?php echo get_permalink(); ?>">
  71. <h3><?php echo get_the_title(); ?></h3>
  72. </a>
  73. </div>
  74. <?php endwhile; ?>
  75. <?php the_posts_navigation(); ?>
  76. <?php
  77. else :
  78. get_template_part('template-parts/content', 'none');
  79. endif;
  80. ?>
  81. </div>
  82. </section>
  83. </div>
  84. </main><!-- #main -->
  85. <style>
  86. header {
  87. height: 100px !important;
  88. }
  89. #all-news {
  90. display: flex;
  91. flex-direction: column;
  92. }
  93. #all-news h2 {
  94. color: #000 !important;
  95. margin-top: 40px;
  96. margin-bottom: 20px;
  97. }
  98. #all-news .stub {
  99. margin: 30px auto;
  100. }
  101. #all-news .stub-img-holder {
  102. height: 200px;
  103. overflow: hidden;
  104. }
  105. #all-news .stub-img-holder img {
  106. height: 100%;
  107. width: 100%;
  108. -o-object-fit: cover;
  109. object-fit: cover;
  110. -o-object-position: center;
  111. object-position: center;
  112. }
  113. #all-news .news-date {
  114. display: block;
  115. color: #485680;
  116. font-weight: 800;
  117. font-size: 14px;
  118. margin: 10px 0px !important;
  119. }
  120. #all-news h3 {
  121. height: 50px;
  122. font-size: 18px;
  123. line-height: 22px;
  124. font-family: "Open Sans", sans-serif;
  125. color: #2F4858 !important;
  126. margin: 20px auto;
  127. }
  128. /*# sourceMappingURL=archive-news.css.map */
  129. </style>
  130. <?php
  131. get_footer();