single-news.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <?php
  2. /**
  3. * The template for displaying all single news posts
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
  6. *
  7. * @package UIU_CSE
  8. */
  9. get_header(); ?>
  10. <?php while (have_posts()) : the_post(); ?>
  11. <main id="main" class="site-main" role="main">
  12. <div class="sections">
  13. <section id="news-single-header" class="container">
  14. <h5>News</h5>
  15. <h1><?php echo get_the_title(); ?></h1>
  16. <p class="subtext">
  17. <?php echo get_the_excerpt(); ?>
  18. </p>
  19. <span class="news-date single"><?php the_field('news_date'); ?></span>
  20. <hr>
  21. <div class="news-socials">
  22. <div>
  23. SHARE:
  24. <a href="#" class="social-icons"><i class="fa-brands fa-facebook-f"></i></a>
  25. <a href="#" class="social-icons"><i class="fa-brands fa-twitter"></i></a>
  26. <a href="#" class="social-icons"><i class="fa-brands fa-linkedin-in"></i></a>
  27. </div>
  28. </div>
  29. </section>
  30. <section id="news-single-header" class="container">
  31. <div class="news-single-body">
  32. <span class="author"> By <?php echo get_the_author_meta('display_name'); ?></span>
  33. <div class="article-cover-image">
  34. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  35. <span class="img-caption"> </span>
  36. </div>
  37. <div class="article">
  38. <?php echo get_the_content(); ?>
  39. </div>
  40. <hr>
  41. </div>
  42. </section>
  43. <section id="more-news" class="container">
  44. <h2>In Other News</h2>
  45. <div class="grid">
  46. <div class="stub">
  47. <div class="stub-img-holder">
  48. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
  49. </div>
  50. <span class="news-date">January 1, 2023</span>
  51. <a href="#">
  52. <h3>Learning to make a museum more accessible</h3>
  53. </a>
  54. </div>
  55. <div class="stub">
  56. <div class="stub-img-holder">
  57. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
  58. </div>
  59. <span class="news-date">January 1, 2023</span>
  60. <a href="#">
  61. <h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
  62. </a>
  63. </div>
  64. <div class="stub">
  65. <div class="stub-img-holder">
  66. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
  67. </div>
  68. <span class="news-date">January 5, 2023</span>
  69. <a href="#">
  70. <h3>New center at addresses the forces shaping early childhood</h3>
  71. </a>
  72. </div>
  73. </div>
  74. <div class="grid">
  75. <div class="stub">
  76. <div class="stub-img-holder">
  77. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_05.jpg" alt="">
  78. </div>
  79. <span class="news-date">January 1, 2023</span>
  80. <a href="#">
  81. <h3>Learning to make a museum more accessible</h3>
  82. </a>
  83. </div>
  84. <div class="stub">
  85. <div class="stub-img-holder">
  86. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/campus_02.jpg" alt="">
  87. </div>
  88. <span class="news-date">January 1, 2023</span>
  89. <a href="#">
  90. <h3>New blood test to identify infections could reduce global antibiotic overuse</h3>
  91. </a>
  92. </div>
  93. <div class="stub">
  94. <div class="stub-img-holder">
  95. <img class="stub-img" src="<?php echo (get_template_directory_uri()) ?>/img/gettybacktoschool.webp" alt="">
  96. </div>
  97. <span class="news-date">January 5, 2023</span>
  98. <a href="#">
  99. <h3>New center at addresses the forces shaping early childhood</h3>
  100. </a>
  101. </div>
  102. </div>
  103. </section>
  104. </div>
  105. </main>
  106. <?php endwhile; ?>
  107. <style>
  108. p {
  109. max-width: 100% !important;
  110. }
  111. header {
  112. height: 100px !important;
  113. }
  114. #news-single-header h5 {
  115. margin-top: 30px;
  116. font-size: 30px;
  117. }
  118. #news-single-header h1 {
  119. color: #000 !important;
  120. font-family: "DM Serif Text", serif;
  121. }
  122. #news-single-header h5 {
  123. color: #2F4858;
  124. font-size: 34px;
  125. }
  126. #news-single-header .subtext {
  127. font-size: 22px !important;
  128. color: #2F4858 !important;
  129. }
  130. #news-single-header .news-date {
  131. display: block;
  132. color: #485680;
  133. font-weight: 800;
  134. font-size: 14px;
  135. }
  136. .news-socials {
  137. margin: 20px 20px !important;
  138. font-size: 26x;
  139. }
  140. .news-socials a {
  141. margin: 0px 15px;
  142. }
  143. .social-icons {
  144. color: #2F4858;
  145. }
  146. .news-single-body {
  147. max-width: 900px !important;
  148. margin: 30px auto !important;
  149. }
  150. .news-single-body p {
  151. font-size: 18px;
  152. color: #2F4858 !important;
  153. }
  154. .news-single-body h3 {
  155. font-family: "DM Serif Text", serif;
  156. font-size: 26px;
  157. color: #2F4858;
  158. }
  159. .news-single-body .author {
  160. display: block;
  161. color: rgba(0, 0, 0, 0.6431372549);
  162. margin: 20px auto !important;
  163. }
  164. .img-caption {
  165. font-size: 14px;
  166. color: #475481 !important;
  167. line-height: 14px;
  168. }
  169. #more-news {
  170. display: flex;
  171. flex-direction: column;
  172. }
  173. #more-news h2 {
  174. color: #000 !important;
  175. width: 100%;
  176. text-align: center;
  177. }
  178. #more-news .stub {
  179. margin: 30px auto;
  180. }
  181. #more-news .stub-img-holder {
  182. height: 300px;
  183. overflow: hidden;
  184. }
  185. #more-news .stub-img-holder img {
  186. height: 100%;
  187. width: 100%;
  188. -o-object-fit: cover;
  189. object-fit: cover;
  190. -o-object-position: center;
  191. object-position: center;
  192. }
  193. #more-news .news-date {
  194. display: block;
  195. color: #485680;
  196. font-weight: 800;
  197. font-size: 14px;
  198. margin: 10px 0px !important;
  199. }
  200. #more-news h3 {
  201. height: 50px;
  202. font-size: 18px;
  203. line-height: 22px;
  204. font-family: "Open Sans", sans-serif;
  205. color: #2F4858 !important;
  206. margin: 20px auto;
  207. }
  208. /*# sourceMappingURL=single-news.css.map */
  209. </style>
  210. <?php get_footer(); ?>